<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /Users/paulross/dev/Python-3.6.2/Include/pyport.h</title>
  </head>
  <body>
    <h1>File: /Users/paulross/dev/Python-3.6.2/Include/pyport.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="Maybe">       1:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_UHlfUFlQT1JUX0hfMA__"><span class="b">Py_PYPORT_H</span></a>
<a name="2" /><span class="Maybe">       2:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfUFlQT1JUX0hfMA__"><span class="b">Py_PYPORT_H</span></a>
<a name="3" /><span class="Maybe">       3:</span> 
<a name="4" /><span class="Maybe">       4:</span> <span class="f">#</span><span class="n">include</span> <span class="e">&quot;pyconfig.h&quot;</span> <span class="k">/* include for defines */</span>
<a name="5" /><span class="Maybe">       5:</span> 
<a name="6" /><span class="Maybe">       6:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">inttypes</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="7" /><span class="Maybe">       7:</span> 
<a name="8" /><span class="Maybe">       8:</span> <span class="k">/**************************************************************************</span>
<a name="9" /><span class="Maybe">       9:</span> <span class="k">Symbols and macros to supply platform-independent interfaces to basic</span>
<a name="10" /><span class="Maybe">      10:</span> <span class="k">C language &amp; library operations whose spellings vary across platforms.</span>
<a name="11" /><span class="Maybe">      11:</span> <span class="k"></span>
<a name="12" /><span class="Maybe">      12:</span> <span class="k">Please try to make documentation here as clear as possible:  by definition,</span>
<a name="13" /><span class="Maybe">      13:</span> <span class="k">the stuff here is trying to illuminate C&apos;s darkest corners.</span>
<a name="14" /><span class="Maybe">      14:</span> <span class="k"></span>
<a name="15" /><span class="Maybe">      15:</span> <span class="k">Config #defines referenced here:</span>
<a name="16" /><span class="Maybe">      16:</span> <span class="k"></span>
<a name="17" /><span class="Maybe">      17:</span> <span class="k">SIGNED_RIGHT_SHIFT_ZERO_FILLS</span>
<a name="18" /><span class="Maybe">      18:</span> <span class="k">Meaning:  To be defined iff i&gt;&gt;j does not extend the sign bit when i is a</span>
<a name="19" /><span class="Maybe">      19:</span> <span class="k">          signed integral type and i &lt; 0.</span>
<a name="20" /><span class="Maybe">      20:</span> <span class="k">Used in:  Py_ARITHMETIC_RIGHT_SHIFT</span>
<a name="21" /><span class="Maybe">      21:</span> <span class="k"></span>
<a name="22" /><span class="Maybe">      22:</span> <span class="k">Py_DEBUG</span>
<a name="23" /><span class="Maybe">      23:</span> <span class="k">Meaning:  Extra checks compiled in for debug mode.</span>
<a name="24" /><span class="Maybe">      24:</span> <span class="k">Used in:  Py_SAFE_DOWNCAST</span>
<a name="25" /><span class="Maybe">      25:</span> <span class="k"></span>
<a name="26" /><span class="Maybe">      26:</span> <span class="k">**************************************************************************/</span>
<a name="27" /><span class="Maybe">      27:</span> 
<a name="28" /><span class="Maybe">      28:</span> <span class="k">/* typedefs for some C9X-defined synonyms for integral types.</span>
<a name="29" /><span class="Maybe">      29:</span> <span class="k"> *</span>
<a name="30" /><span class="Maybe">      30:</span> <span class="k"> * The names in Python are exactly the same as the C9X names, except with a</span>
<a name="31" /><span class="Maybe">      31:</span> <span class="k"> * Py_ prefix.  Until C9X is universally implemented, this is the only way</span>
<a name="32" /><span class="Maybe">      32:</span> <span class="k"> * to ensure that Python gets reliable names that don&apos;t conflict with names</span>
<a name="33" /><span class="Maybe">      33:</span> <span class="k"> * in non-Python code that are playing their own tricks to define the C9X</span>
<a name="34" /><span class="Maybe">      34:</span> <span class="k"> * names.</span>
<a name="35" /><span class="Maybe">      35:</span> <span class="k"> *</span>
<a name="36" /><span class="Maybe">      36:</span> <span class="k"> * NOTE: don&apos;t go nuts here!  Python has no use for *most* of the C9X</span>
<a name="37" /><span class="Maybe">      37:</span> <span class="k"> * integral synonyms.  Only define the ones we actually need.</span>
<a name="38" /><span class="Maybe">      38:</span> <span class="k"> */</span>
<a name="39" /><span class="Maybe">      39:</span> 
<a name="40" /><span class="Maybe">      40:</span> <span class="k">/* long long is required. Ensure HAVE_LONG_LONG is defined for compatibility. */</span>
<a name="41" /><span class="Maybe">      41:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_SEFWRV9MT05HX0xPTkdfMA__"><span class="b">HAVE_LONG_LONG</span></a>
<a name="42" /><span class="Maybe">      42:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_SEFWRV9MT05HX0xPTkdfMA__"><span class="b">HAVE_LONG_LONG</span></a> <span class="c">1</span>
<a name="43" /><span class="Maybe">      43:</span> <span class="f">#</span><span class="n">endif</span>
<a name="44" /><span class="Maybe">      44:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_UFlfTE9OR19MT05HXzA_"><span class="b">PY_LONG_LONG</span></a>
<a name="45" /><span class="Maybe">      45:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UFlfTE9OR19MT05HXzA_"><span class="b">PY_LONG_LONG</span></a> <span class="m">long</span> <span class="m">long</span>
<a name="46" /><span class="Maybe">      46:</span> <span class="k">/* If LLONG_MAX is defined in limits.h, use that. */</span>
<a name="47" /><span class="Maybe">      47:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfTExPTkdfTUlOXzA_"><span class="b">PY_LLONG_MIN</span></a> <a href="macros_noref.html#_TExPTkdfTUlOXzA_"><span class="b">LLONG_MIN</span></a>
<a name="48" /><span class="Maybe">      48:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfTExPTkdfTUFYXzA_"><span class="b">PY_LLONG_MAX</span></a> <a href="macros_noref.html#_TExPTkdfTUFYXzA_"><span class="b">LLONG_MAX</span></a>
<a name="49" /><span class="Maybe">      49:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfVUxMT05HX01BWF8w"><span class="b">PY_ULLONG_MAX</span></a> <a href="macros_noref.html#_VUxMT05HX01BWF8w"><span class="b">ULLONG_MAX</span></a>
<a name="50" /><span class="Maybe">      50:</span> <span class="f">#</span><span class="n">endif</span>
<a name="51" /><span class="Maybe">      51:</span> 
<a name="52" /><span class="Maybe">      52:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfVUlOVDMyX1RfMA__"><span class="b">PY_UINT32_T</span></a> <span class="b">uint32_t</span>
<a name="53" /><span class="Maybe">      53:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfVUlOVDY0X1RfMA__"><span class="b">PY_UINT64_T</span></a> <span class="b">uint64_t</span>
<a name="54" /><span class="Maybe">      54:</span> 
<a name="55" /><span class="Maybe">      55:</span> <span class="k">/* Signed variants of the above */</span>
<a name="56" /><span class="Maybe">      56:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfSU5UMzJfVF8w"><span class="b">PY_INT32_T</span></a> <span class="b">int32_t</span>
<a name="57" /><span class="Maybe">      57:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfSU5UNjRfVF8w"><span class="b">PY_INT64_T</span></a> <span class="b">int64_t</span>
<a name="58" /><span class="Maybe">      58:</span> 
<a name="59" /><span class="Maybe">      59:</span> <span class="k">/* If PYLONG_BITS_IN_DIGIT is not defined then we&apos;ll use 30-bit digits if all</span>
<a name="60" /><span class="Maybe">      60:</span> <span class="k">   the necessary integer types are available, and we&apos;re on a 64-bit platform</span>
<a name="61" /><span class="Maybe">      61:</span> <span class="k">   (as determined by SIZEOF_VOID_P); otherwise we use 15-bit digits. */</span>
<a name="62" /><span class="Maybe">      62:</span> 
<a name="63" /><span class="Maybe">      63:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_UFlMT05HX0JJVFNfSU5fRElHSVRfMA__"><span class="b">PYLONG_BITS_IN_DIGIT</span></a>
<a name="64" /><span class="Maybe">      64:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_U0laRU9GX1ZPSURfUF8w"><span class="b">SIZEOF_VOID_P</span></a> <span class="f">&gt;=</span> <span class="c">8</span>
<a name="65" /><span class="Maybe">      65:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UFlMT05HX0JJVFNfSU5fRElHSVRfMA__"><span class="b">PYLONG_BITS_IN_DIGIT</span></a> <span class="c">30</span>
<a name="66" /><span class="False">      66:</span> <span class="f">#</span><span class="n">else</span>
<a name="67" /><span class="False">      67:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UFlMT05HX0JJVFNfSU5fRElHSVRfMA__"><span class="b">PYLONG_BITS_IN_DIGIT</span></a> <span class="c">15</span>
<a name="68" /><span class="Maybe">      68:</span> <span class="f">#</span><span class="n">endif</span>
<a name="69" /><span class="Maybe">      69:</span> <span class="f">#</span><span class="n">endif</span>
<a name="70" /><span class="Maybe">      70:</span> 
<a name="71" /><span class="Maybe">      71:</span> <span class="k">/* uintptr_t is the C9X name for an unsigned integral type such that a</span>
<a name="72" /><span class="Maybe">      72:</span> <span class="k"> * legitimate void* can be cast to uintptr_t and then back to void* again</span>
<a name="73" /><span class="Maybe">      73:</span> <span class="k"> * without loss of information.  Similarly for intptr_t, wrt a signed</span>
<a name="74" /><span class="Maybe">      74:</span> <span class="k"> * integral type.</span>
<a name="75" /><span class="Maybe">      75:</span> <span class="k"> */</span>
<a name="76" /><span class="Maybe">      76:</span> <span class="m">typedef</span> <span class="b">uintptr_t</span>       <span class="b">Py_uintptr_t</span><span class="f">;</span>
<a name="77" /><span class="Maybe">      77:</span> <span class="m">typedef</span> <span class="b">intptr_t</span>        <span class="b">Py_intptr_t</span><span class="f">;</span>
<a name="78" /><span class="Maybe">      78:</span> 
<a name="79" /><span class="Maybe">      79:</span> <span class="k">/* Py_ssize_t is a signed integral type such that sizeof(Py_ssize_t) ==</span>
<a name="80" /><span class="Maybe">      80:</span> <span class="k"> * sizeof(size_t).  C99 doesn&apos;t define such a thing directly (size_t is an</span>
<a name="81" /><span class="Maybe">      81:</span> <span class="k"> * unsigned integral type).  See PEP 353 for details.</span>
<a name="82" /><span class="Maybe">      82:</span> <span class="k"> */</span>
<a name="83" /><span class="Maybe">      83:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="macros_ref.html#_SEFWRV9TU0laRV9UXzA_"><span class="b">HAVE_SSIZE_T</span></a>
<a name="84" /><span class="Maybe">      84:</span> <span class="m">typedef</span> <span class="b">ssize_t</span>         <span class="b">Py_ssize_t</span><span class="f">;</span>
<a name="85" /><span class="False">      85:</span> <span class="f">#</span><span class="n">elif</span> <a href="macros_ref.html#_U0laRU9GX1ZPSURfUF8w"><span class="b">SIZEOF_VOID_P</span></a> <span class="f">==</span> <a href="macros_ref.html#_U0laRU9GX1NJWkVfVF8w"><span class="b">SIZEOF_SIZE_T</span></a>
<a name="86" /><span class="False">      86:</span> <span class="m">typedef</span> <span class="b">Py_intptr_t</span>     <span class="b">Py_ssize_t</span><span class="f">;</span>
<a name="87" /><span class="False">      87:</span> <span class="f">#</span><span class="n">else</span>
<a name="88" /><span class="False">      88:</span> <span class="f">#</span>   <span class="n">error</span> <span class="e">&quot;Python needs a typedef for Py_ssize_t in pyport.h.&quot;</span>
<a name="89" /><span class="Maybe">      89:</span> <span class="f">#</span><span class="n">endif</span>
<a name="90" /><span class="Maybe">      90:</span> 
<a name="91" /><span class="Maybe">      91:</span> <span class="k">/* Py_hash_t is the same size as a pointer. */</span>
<a name="92" /><span class="Maybe">      92:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_U0laRU9GX1BZX0hBU0hfVF8w"><span class="b">SIZEOF_PY_HASH_T</span></a> <a href="macros_ref.html#_U0laRU9GX1NJWkVfVF8w"><span class="b">SIZEOF_SIZE_T</span></a>
<a name="93" /><span class="Maybe">      93:</span> <span class="m">typedef</span> <span class="b">Py_ssize_t</span> <span class="b">Py_hash_t</span><span class="f">;</span>
<a name="94" /><span class="Maybe">      94:</span> <span class="k">/* Py_uhash_t is the unsigned equivalent needed to calculate numeric hash. */</span>
<a name="95" /><span class="Maybe">      95:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_U0laRU9GX1BZX1VIQVNIX1RfMA__"><span class="b">SIZEOF_PY_UHASH_T</span></a> <a href="macros_ref.html#_U0laRU9GX1NJWkVfVF8w"><span class="b">SIZEOF_SIZE_T</span></a>
<a name="96" /><span class="Maybe">      96:</span> <span class="m">typedef</span> <span class="b">size_t</span> <span class="b">Py_uhash_t</span><span class="f">;</span>
<a name="97" /><span class="Maybe">      97:</span> 
<a name="98" /><span class="Maybe">      98:</span> <span class="k">/* Only used for compatibility with code that may not be PY_SSIZE_T_CLEAN. */</span>
<a name="99" /><span class="False">      99:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">PY_SSIZE_T_CLEAN</span>
<a name="100" /><span class="False">     100:</span> <span class="m">typedef</span> <span class="b">Py_ssize_t</span> <span class="b">Py_ssize_clean_t</span><span class="f">;</span>
<a name="101" /><span class="Maybe">     101:</span> <span class="f">#</span><span class="n">else</span>
<a name="102" /><span class="Maybe">     102:</span> <span class="m">typedef</span> <span class="m">int</span> <span class="b">Py_ssize_clean_t</span><span class="f">;</span>
<a name="103" /><span class="Maybe">     103:</span> <span class="f">#</span><span class="n">endif</span>
<a name="104" /><span class="Maybe">     104:</span> 
<a name="105" /><span class="Maybe">     105:</span> <span class="k">/* Largest possible value of size_t. */</span>
<a name="106" /><span class="Maybe">     106:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfU0laRV9NQVhfMA__"><span class="b">PY_SIZE_MAX</span></a> <a href="macros_noref.html#_U0laRV9NQVhfMA__"><span class="b">SIZE_MAX</span></a>
<a name="107" /><span class="Maybe">     107:</span> 
<a name="108" /><span class="Maybe">     108:</span> <span class="k">/* Largest positive value of type Py_ssize_t. */</span>
<a name="109" /><span class="Maybe">     109:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UFlfU1NJWkVfVF9NQVhfMA__"><span class="b">PY_SSIZE_T_MAX</span></a> <span class="f">(</span><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span><span class="f">(</span><span class="f">(</span><span class="f">(</span><span class="b">size_t</span><span class="f">)</span><span class="f">-</span><span class="c">1</span><span class="f">)</span><span class="f">&gt;&gt;</span><span class="c">1</span><span class="f">)</span><span class="f">)</span>
<a name="110" /><span class="Maybe">     110:</span> <span class="k">/* Smallest negative value of type Py_ssize_t. */</span>
<a name="111" /><span class="Maybe">     111:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfU1NJWkVfVF9NSU5fMA__"><span class="b">PY_SSIZE_T_MIN</span></a> <span class="f">(</span><span class="f">-</span><a href="macros_ref.html#_UFlfU1NJWkVfVF9NQVhfMA__"><span class="b">PY_SSIZE_T_MAX</span></a><span class="f">-</span><span class="c">1</span><span class="f">)</span>
<a name="112" /><span class="Maybe">     112:</span> 
<a name="113" /><span class="Maybe">     113:</span> <span class="k">/* PY_FORMAT_SIZE_T is a platform-specific modifier for use in a printf</span>
<a name="114" /><span class="Maybe">     114:</span> <span class="k"> * format to convert an argument with the width of a size_t or Py_ssize_t.</span>
<a name="115" /><span class="Maybe">     115:</span> <span class="k"> * C99 introduced &quot;z&quot; for this purpose, but not all platforms support that;</span>
<a name="116" /><span class="Maybe">     116:</span> <span class="k"> * e.g., MS compilers use &quot;I&quot; instead.</span>
<a name="117" /><span class="Maybe">     117:</span> <span class="k"> *</span>
<a name="118" /><span class="Maybe">     118:</span> <span class="k"> * These &quot;high level&quot; Python format functions interpret &quot;z&quot; correctly on</span>
<a name="119" /><span class="Maybe">     119:</span> <span class="k"> * all platforms (Python interprets the format string itself, and does whatever</span>
<a name="120" /><span class="Maybe">     120:</span> <span class="k"> * the platform C requires to convert a size_t/Py_ssize_t argument):</span>
<a name="121" /><span class="Maybe">     121:</span> <span class="k"> *</span>
<a name="122" /><span class="Maybe">     122:</span> <span class="k"> *     PyBytes_FromFormat</span>
<a name="123" /><span class="Maybe">     123:</span> <span class="k"> *     PyErr_Format</span>
<a name="124" /><span class="Maybe">     124:</span> <span class="k"> *     PyBytes_FromFormatV</span>
<a name="125" /><span class="Maybe">     125:</span> <span class="k"> *     PyUnicode_FromFormatV</span>
<a name="126" /><span class="Maybe">     126:</span> <span class="k"> *</span>
<a name="127" /><span class="Maybe">     127:</span> <span class="k"> * Lower-level uses require that you interpolate the correct format modifier</span>
<a name="128" /><span class="Maybe">     128:</span> <span class="k"> * yourself (e.g., calling printf, fprintf, sprintf, PyOS_snprintf); for</span>
<a name="129" /><span class="Maybe">     129:</span> <span class="k"> * example,</span>
<a name="130" /><span class="Maybe">     130:</span> <span class="k"> *</span>
<a name="131" /><span class="Maybe">     131:</span> <span class="k"> *     Py_ssize_t index;</span>
<a name="132" /><span class="Maybe">     132:</span> <span class="k"> *     fprintf(stderr, &quot;index %&quot; PY_FORMAT_SIZE_T &quot;d sucks\n&quot;, index);</span>
<a name="133" /><span class="Maybe">     133:</span> <span class="k"> *</span>
<a name="134" /><span class="Maybe">     134:</span> <span class="k"> * That will expand to %ld, or %Id, or to something else correct for a</span>
<a name="135" /><span class="Maybe">     135:</span> <span class="k"> * Py_ssize_t on the platform.</span>
<a name="136" /><span class="Maybe">     136:</span> <span class="k"> */</span>
<a name="137" /><span class="False">     137:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_UFlfRk9STUFUX1NJWkVfVF8w"><span class="b">PY_FORMAT_SIZE_T</span></a>
<a name="138" /><span class="False">     138:</span> <span class="f">#</span>   <span class="n">if</span> <a href="macros_ref.html#_U0laRU9GX1NJWkVfVF8w"><span class="b">SIZEOF_SIZE_T</span></a> <span class="f">==</span> <a href="macros_ref.html#_U0laRU9GX0lOVF8w"><span class="b">SIZEOF_INT</span></a> <span class="f">&amp;&amp;</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">__APPLE__</span><span class="f">)</span>
<a name="139" /><span class="False">     139:</span> <span class="f">#</span>       <span class="n">define</span> <a href="macros_ref.html#_UFlfRk9STUFUX1NJWkVfVF8w"><span class="b">PY_FORMAT_SIZE_T</span></a> <span class="e">&quot;&quot;</span>
<a name="140" /><span class="False">     140:</span> <span class="f">#</span>   <span class="n">elif</span> <a href="macros_ref.html#_U0laRU9GX1NJWkVfVF8w"><span class="b">SIZEOF_SIZE_T</span></a> <span class="f">==</span> <a href="macros_ref.html#_U0laRU9GX0xPTkdfMA__"><span class="b">SIZEOF_LONG</span></a>
<a name="141" /><span class="False">     141:</span> <span class="f">#</span>       <span class="n">define</span> <a href="macros_ref.html#_UFlfRk9STUFUX1NJWkVfVF8w"><span class="b">PY_FORMAT_SIZE_T</span></a> <span class="e">&quot;l&quot;</span>
<a name="142" /><span class="False">     142:</span> <span class="f">#</span>   <span class="n">elif</span> <span class="b">defined</span><span class="f">(</span><span class="b">MS_WINDOWS</span><span class="f">)</span>
<a name="143" /><span class="False">     143:</span> <span class="f">#</span>       <span class="n">define</span> <a href="macros_ref.html#_UFlfRk9STUFUX1NJWkVfVF8w"><span class="b">PY_FORMAT_SIZE_T</span></a> <span class="e">&quot;I&quot;</span>
<a name="144" /><span class="False">     144:</span> <span class="f">#</span>   <span class="n">else</span>
<a name="145" /><span class="False">     145:</span> <span class="f">#</span>       <span class="n">error</span> <span class="e">&quot;This platform&apos;s pyconfig.h needs to define PY_FORMAT_SIZE_T&quot;</span>
<a name="146" /><span class="False">     146:</span> <span class="f">#</span>   <span class="n">endif</span>
<a name="147" /><span class="Maybe">     147:</span> <span class="f">#</span><span class="n">endif</span>
<a name="148" /><span class="Maybe">     148:</span> 
<a name="149" /><span class="Maybe">     149:</span> <span class="k">/* Py_LOCAL can be used instead of static to get the fastest possible calling</span>
<a name="150" /><span class="Maybe">     150:</span> <span class="k"> * convention for functions that are local to a given module.</span>
<a name="151" /><span class="Maybe">     151:</span> <span class="k"> *</span>
<a name="152" /><span class="Maybe">     152:</span> <span class="k"> * Py_LOCAL_INLINE does the same thing, and also explicitly requests inlining,</span>
<a name="153" /><span class="Maybe">     153:</span> <span class="k"> * for platforms that support that.</span>
<a name="154" /><span class="Maybe">     154:</span> <span class="k"> *</span>
<a name="155" /><span class="Maybe">     155:</span> <span class="k"> * If PY_LOCAL_AGGRESSIVE is defined before python.h is included, more</span>
<a name="156" /><span class="Maybe">     156:</span> <span class="k"> * &quot;aggressive&quot; inlining/optimization is enabled for the entire module.  This</span>
<a name="157" /><span class="Maybe">     157:</span> <span class="k"> * may lead to code bloat, and may slow things down for those reasons.  It may</span>
<a name="158" /><span class="Maybe">     158:</span> <span class="k"> * also lead to errors, if the code relies on pointer aliasing.  Use with</span>
<a name="159" /><span class="Maybe">     159:</span> <span class="k"> * care.</span>
<a name="160" /><span class="Maybe">     160:</span> <span class="k"> *</span>
<a name="161" /><span class="Maybe">     161:</span> <span class="k"> * NOTE: You can only use this for functions that are entirely local to a</span>
<a name="162" /><span class="Maybe">     162:</span> <span class="k"> * module; functions that are exported via method tables, callbacks, etc,</span>
<a name="163" /><span class="Maybe">     163:</span> <span class="k"> * should keep using static.</span>
<a name="164" /><span class="Maybe">     164:</span> <span class="k"> */</span>
<a name="165" /><span class="Maybe">     165:</span> 
<a name="166" /><span class="False">     166:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">_MSC_VER</span><span class="f">)</span>
<a name="167" /><span class="False">     167:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">PY_LOCAL_AGGRESSIVE</span><span class="f">)</span>
<a name="168" /><span class="False">     168:</span> <span class="k">/* enable more aggressive optimization for visual studio */</span>
<a name="169" /><span class="False">     169:</span> <span class="f">#</span><span class="n">pragma</span> <span class="b">optimize</span><span class="f">(</span><span class="e">&quot;agtw&quot;</span><span class="f">,</span> <span class="b">on</span><span class="f">)</span>
<a name="170" /><span class="False">     170:</span> <span class="f">#</span><span class="n">endif</span>
<a name="171" /><span class="False">     171:</span> <span class="k">/* ignore warnings if the compiler decides not to inline a function */</span>
<a name="172" /><span class="False">     172:</span> <span class="f">#</span><span class="n">pragma</span> <span class="b">warning</span><span class="f">(</span><span class="b">disable</span><span class="f">:</span> <span class="c">4710</span><span class="f">)</span>
<a name="173" /><span class="False">     173:</span> <span class="k">/* fastest possible local call under MSVC */</span>
<a name="174" /><span class="False">     174:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfTE9DQUxfMA__"><span class="b">Py_LOCAL</span></a><span class="f">(</span><span class="b">type</span><span class="f">)</span> <span class="m">static</span> <span class="b">type</span> <span class="b">__fastcall</span>
<a name="175" /><span class="False">     175:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfTE9DQUxfSU5MSU5FXzA_"><span class="b">Py_LOCAL_INLINE</span></a><span class="f">(</span><span class="b">type</span><span class="f">)</span> <span class="m">static</span> <span class="b">__inline</span> <span class="b">type</span> <span class="b">__fastcall</span>
<a name="176" /><span class="Maybe">     176:</span> <span class="f">#</span><span class="n">elif</span> <span class="b">defined</span><span class="f">(</span><a href="macros_ref.html#_VVNFX0lOTElORV8w"><span class="b">USE_INLINE</span></a><span class="f">)</span>
<a name="177" /><span class="Maybe">     177:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfTE9DQUxfMA__"><span class="b">Py_LOCAL</span></a><span class="f">(</span><span class="b">type</span><span class="f">)</span> <span class="m">static</span> <span class="b">type</span>
<a name="178" /><span class="Maybe">     178:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfTE9DQUxfSU5MSU5FXzA_"><span class="b">Py_LOCAL_INLINE</span></a><span class="f">(</span><span class="b">type</span><span class="f">)</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">type</span>
<a name="179" /><span class="False">     179:</span> <span class="f">#</span><span class="n">else</span>
<a name="180" /><span class="False">     180:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfTE9DQUxfMA__"><span class="b">Py_LOCAL</span></a><span class="f">(</span><span class="b">type</span><span class="f">)</span> <span class="m">static</span> <span class="b">type</span>
<a name="181" /><span class="False">     181:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfTE9DQUxfSU5MSU5FXzA_"><span class="b">Py_LOCAL_INLINE</span></a><span class="f">(</span><span class="b">type</span><span class="f">)</span> <span class="m">static</span> <span class="b">type</span>
<a name="182" /><span class="Maybe">     182:</span> <span class="f">#</span><span class="n">endif</span>
<a name="183" /><span class="Maybe">     183:</span> 
<a name="184" /><span class="Maybe">     184:</span> <span class="k">/* Py_MEMCPY is kept for backwards compatibility,</span>
<a name="185" /><span class="Maybe">     185:</span> <span class="k"> * see https://bugs.python.org/issue28126 */</span>
<a name="186" /><span class="Maybe">     186:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfTUVNQ1BZXzA_"><span class="b">Py_MEMCPY</span></a> <a href="macros_noref.html#_bWVtY3B5XzA_"><span class="b">memcpy</span></a>
<a name="187" /><span class="Maybe">     187:</span> 
<a name="188" /><span class="Maybe">     188:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">stdlib</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="189" /><span class="Maybe">     189:</span> 
<a name="190" /><span class="False">     190:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">HAVE_IEEEFP_H</span>
<a name="191" /><span class="False">     191:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">ieeefp</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>  <span class="k">/* needed for &apos;finite&apos; declaration on some platforms */</span>
<a name="192" /><span class="Maybe">     192:</span> <span class="f">#</span><span class="n">endif</span>
<a name="193" /><span class="Maybe">     193:</span> 
<a name="194" /><span class="Maybe">     194:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">math</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span> <span class="k">/* Moved here from the math section, before extern &quot;C&quot; */</span>
<a name="195" /><span class="Maybe">     195:</span> 
<a name="196" /><span class="Maybe">     196:</span> <span class="k">/********************************************</span>
<a name="197" /><span class="Maybe">     197:</span> <span class="k"> * WRAPPER FOR &lt;time.h&gt; and/or &lt;sys/time.h&gt; *</span>
<a name="198" /><span class="Maybe">     198:</span> <span class="k"> ********************************************/</span>
<a name="199" /><span class="Maybe">     199:</span> 
<a name="200" /><span class="Maybe">     200:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="macros_ref.html#_VElNRV9XSVRIX1NZU19USU1FXzA_"><span class="b">TIME_WITH_SYS_TIME</span></a>
<a name="201" /><span class="Maybe">     201:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">sys</span><span class="f">/</span><span class="b">time</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="202" /><span class="Maybe">     202:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">time</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="203" /><span class="False">     203:</span> <span class="f">#</span><span class="n">else</span> <span class="k">/* !TIME_WITH_SYS_TIME */</span>
<a name="204" /><span class="False">     204:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="macros_ref.html#_SEFWRV9TWVNfVElNRV9IXzA_"><span class="b">HAVE_SYS_TIME_H</span></a>
<a name="205" /><span class="False">     205:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">sys</span><span class="f">/</span><span class="b">time</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="206" /><span class="False">     206:</span> <span class="f">#</span><span class="n">else</span> <span class="k">/* !HAVE_SYS_TIME_H */</span>
<a name="207" /><span class="False">     207:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">time</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="208" /><span class="False">     208:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !HAVE_SYS_TIME_H */</span>
<a name="209" /><span class="Maybe">     209:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !TIME_WITH_SYS_TIME */</span>
<a name="210" /><span class="Maybe">     210:</span> 
<a name="211" /><span class="Maybe">     211:</span> 
<a name="212" /><span class="Maybe">     212:</span> <span class="k">/******************************</span>
<a name="213" /><span class="Maybe">     213:</span> <span class="k"> * WRAPPER FOR &lt;sys/select.h&gt; *</span>
<a name="214" /><span class="Maybe">     214:</span> <span class="k"> ******************************/</span>
<a name="215" /><span class="Maybe">     215:</span> 
<a name="216" /><span class="Maybe">     216:</span> <span class="k">/* NB caller must include &lt;sys/types.h&gt; */</span>
<a name="217" /><span class="Maybe">     217:</span> 
<a name="218" /><span class="Maybe">     218:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="macros_ref.html#_SEFWRV9TWVNfU0VMRUNUX0hfMA__"><span class="b">HAVE_SYS_SELECT_H</span></a>
<a name="219" /><span class="Maybe">     219:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">sys</span><span class="f">/</span><span class="b">select</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="220" /><span class="Maybe">     220:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !HAVE_SYS_SELECT_H */</span>
<a name="221" /><span class="Maybe">     221:</span> 
<a name="222" /><span class="Maybe">     222:</span> <span class="k">/*******************************</span>
<a name="223" /><span class="Maybe">     223:</span> <span class="k"> * stat() and fstat() fiddling *</span>
<a name="224" /><span class="Maybe">     224:</span> <span class="k"> *******************************/</span>
<a name="225" /><span class="Maybe">     225:</span> 
<a name="226" /><span class="Maybe">     226:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="macros_ref.html#_SEFWRV9TWVNfU1RBVF9IXzA_"><span class="b">HAVE_SYS_STAT_H</span></a>
<a name="227" /><span class="Maybe">     227:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">sys</span><span class="f">/</span><span class="b">stat</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="228" /><span class="False">     228:</span> <span class="f">#</span><span class="n">elif</span> <span class="b">defined</span><span class="f">(</span><span class="b">HAVE_STAT_H</span><span class="f">)</span>
<a name="229" /><span class="False">     229:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">stat</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="230" /><span class="Maybe">     230:</span> <span class="f">#</span><span class="n">endif</span>
<a name="231" /><span class="Maybe">     231:</span> 
<a name="232" /><span class="False">     232:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_U19JRk1UXzA_"><span class="b">S_IFMT</span></a>
<a name="233" /><span class="False">     233:</span> <span class="k">/* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */</span>
<a name="234" /><span class="False">     234:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_U19JRk1UXzA_"><span class="b">S_IFMT</span></a> <span class="c">0170000</span>
<a name="235" /><span class="Maybe">     235:</span> <span class="f">#</span><span class="n">endif</span>
<a name="236" /><span class="Maybe">     236:</span> 
<a name="237" /><span class="False">     237:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_U19JRkxOS18w"><span class="b">S_IFLNK</span></a>
<a name="238" /><span class="False">     238:</span> <span class="k">/* Windows doesn&apos;t define S_IFLNK but posixmodule.c maps</span>
<a name="239" /><span class="False">     239:</span> <span class="k"> * IO_REPARSE_TAG_SYMLINK to S_IFLNK */</span>
<a name="240" /><span class="False">     240:</span> <span class="f">#</span>  <span class="n">define</span> <a href="macros_ref.html#_U19JRkxOS18w"><span class="b">S_IFLNK</span></a> <span class="c">0120000</span>
<a name="241" /><span class="Maybe">     241:</span> <span class="f">#</span><span class="n">endif</span>
<a name="242" /><span class="Maybe">     242:</span> 
<a name="243" /><span class="False">     243:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_U19JU1JFR18w"><span class="b">S_ISREG</span></a>
<a name="244" /><span class="False">     244:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_U19JU1JFR18w"><span class="b">S_ISREG</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">(</span><span class="f">(</span><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">&amp;</span> <a href="macros_ref.html#_U19JRk1UXzA_"><span class="b">S_IFMT</span></a><span class="f">)</span> <span class="f">==</span> <a href="macros_noref.html#_U19JRlJFR18w"><span class="b">S_IFREG</span></a><span class="f">)</span>
<a name="245" /><span class="Maybe">     245:</span> <span class="f">#</span><span class="n">endif</span>
<a name="246" /><span class="Maybe">     246:</span> 
<a name="247" /><span class="False">     247:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_U19JU0RJUl8w"><span class="b">S_ISDIR</span></a>
<a name="248" /><span class="False">     248:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_U19JU0RJUl8w"><span class="b">S_ISDIR</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">(</span><span class="f">(</span><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">&amp;</span> <a href="macros_ref.html#_U19JRk1UXzA_"><span class="b">S_IFMT</span></a><span class="f">)</span> <span class="f">==</span> <a href="macros_noref.html#_U19JRkRJUl8w"><span class="b">S_IFDIR</span></a><span class="f">)</span>
<a name="249" /><span class="Maybe">     249:</span> <span class="f">#</span><span class="n">endif</span>
<a name="250" /><span class="Maybe">     250:</span> 
<a name="251" /><span class="False">     251:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_U19JU0NIUl8w"><span class="b">S_ISCHR</span></a>
<a name="252" /><span class="False">     252:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_U19JU0NIUl8w"><span class="b">S_ISCHR</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">(</span><span class="f">(</span><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">&amp;</span> <a href="macros_ref.html#_U19JRk1UXzA_"><span class="b">S_IFMT</span></a><span class="f">)</span> <span class="f">==</span> <a href="macros_noref.html#_U19JRkNIUl8w"><span class="b">S_IFCHR</span></a><span class="f">)</span>
<a name="253" /><span class="Maybe">     253:</span> <span class="f">#</span><span class="n">endif</span>
<a name="254" /><span class="Maybe">     254:</span> 
<a name="255" /><span class="False">     255:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__cplusplus</span>
<a name="256" /><span class="False">     256:</span> <span class="k">/* Move this down here since some C++ #include&apos;s don&apos;t like to be included</span>
<a name="257" /><span class="False">     257:</span> <span class="k">   inside an extern &quot;C&quot; */</span>
<a name="258" /><span class="False">     258:</span> <span class="m">extern</span> <span class="e">&quot;C&quot;</span> <span class="f">{</span>
<a name="259" /><span class="Maybe">     259:</span> <span class="f">#</span><span class="n">endif</span>
<a name="260" /><span class="Maybe">     260:</span> 
<a name="261" /><span class="Maybe">     261:</span> 
<a name="262" /><span class="Maybe">     262:</span> <span class="k">/* Py_ARITHMETIC_RIGHT_SHIFT</span>
<a name="263" /><span class="Maybe">     263:</span> <span class="k"> * C doesn&apos;t define whether a right-shift of a signed integer sign-extends</span>
<a name="264" /><span class="Maybe">     264:</span> <span class="k"> * or zero-fills.  Here a macro to force sign extension:</span>
<a name="265" /><span class="Maybe">     265:</span> <span class="k"> * Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J)</span>
<a name="266" /><span class="Maybe">     266:</span> <span class="k"> *    Return I &gt;&gt; J, forcing sign extension.  Arithmetically, return the</span>
<a name="267" /><span class="Maybe">     267:</span> <span class="k"> *    floor of I/2**J.</span>
<a name="268" /><span class="Maybe">     268:</span> <span class="k"> * Requirements:</span>
<a name="269" /><span class="Maybe">     269:</span> <span class="k"> *    I should have signed integer type.  In the terminology of C99, this can</span>
<a name="270" /><span class="Maybe">     270:</span> <span class="k"> *    be either one of the five standard signed integer types (signed char,</span>
<a name="271" /><span class="Maybe">     271:</span> <span class="k"> *    short, int, long, long long) or an extended signed integer type.</span>
<a name="272" /><span class="Maybe">     272:</span> <span class="k"> *    J is an integer &gt;= 0 and strictly less than the number of bits in the</span>
<a name="273" /><span class="Maybe">     273:</span> <span class="k"> *    type of I (because C doesn&apos;t define what happens for J outside that</span>
<a name="274" /><span class="Maybe">     274:</span> <span class="k"> *    range either).</span>
<a name="275" /><span class="Maybe">     275:</span> <span class="k"> *    TYPE used to specify the type of I, but is now ignored.  It&apos;s been left</span>
<a name="276" /><span class="Maybe">     276:</span> <span class="k"> *    in for backwards compatibility with versions &lt;= 2.6 or 3.0.</span>
<a name="277" /><span class="Maybe">     277:</span> <span class="k"> * Caution:</span>
<a name="278" /><span class="Maybe">     278:</span> <span class="k"> *    I may be evaluated more than once.</span>
<a name="279" /><span class="Maybe">     279:</span> <span class="k"> */</span>
<a name="280" /><span class="False">     280:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">SIGNED_RIGHT_SHIFT_ZERO_FILLS</span>
<a name="281" /><span class="False">     281:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQVJJVEhNRVRJQ19SSUdIVF9TSElGVF8w"><span class="b">Py_ARITHMETIC_RIGHT_SHIFT</span></a><span class="f">(</span><span class="b">TYPE</span><span class="f">,</span> <span class="b">I</span><span class="f">,</span> <span class="b">J</span><span class="f">)</span> \
<a name="282" /><span class="False">     282:</span>     <span class="f">(</span><span class="f">(</span><span class="b">I</span><span class="f">)</span> <span class="f">&lt;</span> <span class="c">0</span> <span class="f">?</span> <span class="f">-</span><span class="c">1</span><span class="f">-</span><span class="f">(</span><span class="f">(</span><span class="f">-</span><span class="c">1</span><span class="f">-</span><span class="f">(</span><span class="b">I</span><span class="f">)</span><span class="f">)</span> <span class="f">&gt;&gt;</span> <span class="f">(</span><span class="b">J</span><span class="f">)</span><span class="f">)</span> <span class="f">:</span> <span class="f">(</span><span class="b">I</span><span class="f">)</span> <span class="f">&gt;&gt;</span> <span class="f">(</span><span class="b">J</span><span class="f">)</span><span class="f">)</span>
<a name="283" /><span class="Maybe">     283:</span> <span class="f">#</span><span class="n">else</span>
<a name="284" /><span class="Maybe">     284:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQVJJVEhNRVRJQ19SSUdIVF9TSElGVF8w"><span class="b">Py_ARITHMETIC_RIGHT_SHIFT</span></a><span class="f">(</span><span class="b">TYPE</span><span class="f">,</span> <span class="b">I</span><span class="f">,</span> <span class="b">J</span><span class="f">)</span> <span class="f">(</span><span class="f">(</span><span class="b">I</span><span class="f">)</span> <span class="f">&gt;&gt;</span> <span class="f">(</span><span class="b">J</span><span class="f">)</span><span class="f">)</span>
<a name="285" /><span class="Maybe">     285:</span> <span class="f">#</span><span class="n">endif</span>
<a name="286" /><span class="Maybe">     286:</span> 
<a name="287" /><span class="Maybe">     287:</span> <span class="k">/* Py_FORCE_EXPANSION(X)</span>
<a name="288" /><span class="Maybe">     288:</span> <span class="k"> * &quot;Simply&quot; returns its argument.  However, macro expansions within the</span>
<a name="289" /><span class="Maybe">     289:</span> <span class="k"> * argument are evaluated.  This unfortunate trickery is needed to get</span>
<a name="290" /><span class="Maybe">     290:</span> <span class="k"> * token-pasting to work as desired in some cases.</span>
<a name="291" /><span class="Maybe">     291:</span> <span class="k"> */</span>
<a name="292" /><span class="Maybe">     292:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfRk9SQ0VfRVhQQU5TSU9OXzA_"><span class="b">Py_FORCE_EXPANSION</span></a><span class="f">(</span><span class="b">X</span><span class="f">)</span> <span class="b">X</span>
<a name="293" /><span class="Maybe">     293:</span> 
<a name="294" /><span class="Maybe">     294:</span> <span class="k">/* Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW)</span>
<a name="295" /><span class="Maybe">     295:</span> <span class="k"> * Cast VALUE to type NARROW from type WIDE.  In Py_DEBUG mode, this</span>
<a name="296" /><span class="Maybe">     296:</span> <span class="k"> * assert-fails if any information is lost.</span>
<a name="297" /><span class="Maybe">     297:</span> <span class="k"> * Caution:</span>
<a name="298" /><span class="Maybe">     298:</span> <span class="k"> *    VALUE may be evaluated more than once.</span>
<a name="299" /><span class="Maybe">     299:</span> <span class="k"> */</span>
<a name="300" /><span class="Maybe">     300:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="macros_ref.html#_UHlfREVCVUdfMA__"><span class="b">Py_DEBUG</span></a>
<a name="301" /><span class="Maybe">     301:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfU0FGRV9ET1dOQ0FTVF8w"><span class="b">Py_SAFE_DOWNCAST</span></a><span class="f">(</span><span class="b">VALUE</span><span class="f">,</span> <span class="b">WIDE</span><span class="f">,</span> <span class="b">NARROW</span><span class="f">)</span> \
<a name="302" /><span class="Maybe">     302:</span>     <span class="f">(</span><a href="macros_ref.html#_YXNzZXJ0XzA_"><span class="b">assert</span></a><span class="f">(</span><span class="f">(</span><span class="b">WIDE</span><span class="f">)</span><span class="f">(</span><span class="b">NARROW</span><span class="f">)</span><span class="f">(</span><span class="b">VALUE</span><span class="f">)</span> <span class="f">==</span> <span class="f">(</span><span class="b">VALUE</span><span class="f">)</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">NARROW</span><span class="f">)</span><span class="f">(</span><span class="b">VALUE</span><span class="f">)</span><span class="f">)</span>
<a name="303" /><span class="False">     303:</span> <span class="f">#</span><span class="n">else</span>
<a name="304" /><span class="False">     304:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfU0FGRV9ET1dOQ0FTVF8w"><span class="b">Py_SAFE_DOWNCAST</span></a><span class="f">(</span><span class="b">VALUE</span><span class="f">,</span> <span class="b">WIDE</span><span class="f">,</span> <span class="b">NARROW</span><span class="f">)</span> <span class="f">(</span><span class="b">NARROW</span><span class="f">)</span><span class="f">(</span><span class="b">VALUE</span><span class="f">)</span>
<a name="305" /><span class="Maybe">     305:</span> <span class="f">#</span><span class="n">endif</span>
<a name="306" /><span class="Maybe">     306:</span> 
<a name="307" /><span class="Maybe">     307:</span> <span class="k">/* Py_SET_ERRNO_ON_MATH_ERROR(x)</span>
<a name="308" /><span class="Maybe">     308:</span> <span class="k"> * If a libm function did not set errno, but it looks like the result</span>
<a name="309" /><span class="Maybe">     309:</span> <span class="k"> * overflowed or not-a-number, set errno to ERANGE or EDOM.  Set errno</span>
<a name="310" /><span class="Maybe">     310:</span> <span class="k"> * to 0 before calling a libm function, and invoke this macro after,</span>
<a name="311" /><span class="Maybe">     311:</span> <span class="k"> * passing the function result.</span>
<a name="312" /><span class="Maybe">     312:</span> <span class="k"> * Caution:</span>
<a name="313" /><span class="Maybe">     313:</span> <span class="k"> *    This isn&apos;t reliable.  See Py_OVERFLOWED comments.</span>
<a name="314" /><span class="Maybe">     314:</span> <span class="k"> *    X is evaluated more than once.</span>
<a name="315" /><span class="Maybe">     315:</span> <span class="k"> */</span>
<a name="316" /><span class="False">     316:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">__FreeBSD__</span><span class="f">)</span> <span class="f">||</span> <span class="b">defined</span><span class="f">(</span><span class="b">__OpenBSD__</span><span class="f">)</span> <span class="f">||</span> <span class="f">(</span><span class="b">defined</span><span class="f">(</span><span class="b">__hpux</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="b">defined</span><span class="f">(</span><span class="b">__ia64</span><span class="f">)</span><span class="f">)</span>
<a name="317" /><span class="False">     317:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF9FRE9NX0ZPUl9OQU5fMA__"><span class="b">_Py_SET_EDOM_FOR_NAN</span></a><span class="f">(</span><span class="b">X</span><span class="f">)</span> <span class="m">if</span> <span class="f">(</span><a href="macros_noref.html#_aXNuYW5fMA__"><span class="b">isnan</span></a><span class="f">(</span><span class="b">X</span><span class="f">)</span><span class="f">)</span> <a href="macros_noref.html#_ZXJybm9fMA__"><span class="b">errno</span></a> <span class="f">=</span> <a href="macros_noref.html#_RURPTV8w"><span class="b">EDOM</span></a><span class="f">;</span>
<a name="318" /><span class="Maybe">     318:</span> <span class="f">#</span><span class="n">else</span>
<a name="319" /><span class="Maybe">     319:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF9FRE9NX0ZPUl9OQU5fMA__"><span class="b">_Py_SET_EDOM_FOR_NAN</span></a><span class="f">(</span><span class="b">X</span><span class="f">)</span> <span class="f">;</span>
<a name="320" /><span class="Maybe">     320:</span> <span class="f">#</span><span class="n">endif</span>
<a name="321" /><span class="Maybe">     321:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfU0VUX0VSUk5PX09OX01BVEhfRVJST1JfMA__"><span class="b">Py_SET_ERRNO_ON_MATH_ERROR</span></a><span class="f">(</span><span class="b">X</span><span class="f">)</span> \
<a name="322" /><span class="Maybe">     322:</span>     <span class="m">do</span> <span class="f">{</span> \
<a name="323" /><span class="Maybe">     323:</span>         <span class="m">if</span> <span class="f">(</span><a href="macros_noref.html#_ZXJybm9fMA__"><span class="b">errno</span></a> <span class="f">==</span> <span class="c">0</span><span class="f">)</span> <span class="f">{</span> \
<a name="324" /><span class="Maybe">     324:</span>             <span class="m">if</span> <span class="f">(</span><span class="f">(</span><span class="b">X</span><span class="f">)</span> <span class="f">==</span> <a href="macros_noref.html#_UHlfSFVHRV9WQUxfMA__"><span class="b">Py_HUGE_VAL</span></a> <span class="f">||</span> <span class="f">(</span><span class="b">X</span><span class="f">)</span> <span class="f">==</span> <span class="f">-</span><a href="macros_noref.html#_UHlfSFVHRV9WQUxfMA__"><span class="b">Py_HUGE_VAL</span></a><span class="f">)</span> \
<a name="325" /><span class="Maybe">     325:</span>                 <a href="macros_noref.html#_ZXJybm9fMA__"><span class="b">errno</span></a> <span class="f">=</span> <a href="macros_noref.html#_RVJBTkdFXzA_"><span class="b">ERANGE</span></a><span class="f">;</span> \
<a name="326" /><span class="Maybe">     326:</span>             <span class="m">else</span> <a href="macros_noref.html#_X1B5X1NFVF9FRE9NX0ZPUl9OQU5fMA__"><span class="b">_Py_SET_EDOM_FOR_NAN</span></a><span class="f">(</span><span class="b">X</span><span class="f">)</span> \
<a name="327" /><span class="Maybe">     327:</span>         <span class="f">}</span> \
<a name="328" /><span class="Maybe">     328:</span>     <span class="f">}</span> <span class="m">while</span><span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="329" /><span class="Maybe">     329:</span> 
<a name="330" /><span class="Maybe">     330:</span> <span class="k">/* Py_SET_ERANGE_ON_OVERFLOW(x)</span>
<a name="331" /><span class="Maybe">     331:</span> <span class="k"> * An alias of Py_SET_ERRNO_ON_MATH_ERROR for backward-compatibility.</span>
<a name="332" /><span class="Maybe">     332:</span> <span class="k"> */</span>
<a name="333" /><span class="Maybe">     333:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfU0VUX0VSQU5HRV9JRl9PVkVSRkxPV18w"><span class="b">Py_SET_ERANGE_IF_OVERFLOW</span></a><span class="f">(</span><span class="b">X</span><span class="f">)</span> <a href="macros_noref.html#_UHlfU0VUX0VSUk5PX09OX01BVEhfRVJST1JfMA__"><span class="b">Py_SET_ERRNO_ON_MATH_ERROR</span></a><span class="f">(</span><span class="b">X</span><span class="f">)</span>
<a name="334" /><span class="Maybe">     334:</span> 
<a name="335" /><span class="Maybe">     335:</span> <span class="k">/* Py_ADJUST_ERANGE1(x)</span>
<a name="336" /><span class="Maybe">     336:</span> <span class="k"> * Py_ADJUST_ERANGE2(x, y)</span>
<a name="337" /><span class="Maybe">     337:</span> <span class="k"> * Set errno to 0 before calling a libm function, and invoke one of these</span>
<a name="338" /><span class="Maybe">     338:</span> <span class="k"> * macros after, passing the function result(s) (Py_ADJUST_ERANGE2 is useful</span>
<a name="339" /><span class="Maybe">     339:</span> <span class="k"> * for functions returning complex results).  This makes two kinds of</span>
<a name="340" /><span class="Maybe">     340:</span> <span class="k"> * adjustments to errno:  (A) If it looks like the platform libm set</span>
<a name="341" /><span class="Maybe">     341:</span> <span class="k"> * errno=ERANGE due to underflow, clear errno. (B) If it looks like the</span>
<a name="342" /><span class="Maybe">     342:</span> <span class="k"> * platform libm overflowed but didn&apos;t set errno, force errno to ERANGE.  In</span>
<a name="343" /><span class="Maybe">     343:</span> <span class="k"> * effect, we&apos;re trying to force a useful implementation of C89 errno</span>
<a name="344" /><span class="Maybe">     344:</span> <span class="k"> * behavior.</span>
<a name="345" /><span class="Maybe">     345:</span> <span class="k"> * Caution:</span>
<a name="346" /><span class="Maybe">     346:</span> <span class="k"> *    This isn&apos;t reliable.  See Py_OVERFLOWED comments.</span>
<a name="347" /><span class="Maybe">     347:</span> <span class="k"> *    X and Y may be evaluated more than once.</span>
<a name="348" /><span class="Maybe">     348:</span> <span class="k"> */</span>
<a name="349" /><span class="Maybe">     349:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQURKVVNUX0VSQU5HRTFfMA__"><span class="b">Py_ADJUST_ERANGE1</span></a><span class="f">(</span><span class="b">X</span><span class="f">)</span>                                            \
<a name="350" /><span class="Maybe">     350:</span>     <span class="m">do</span> <span class="f">{</span>                                                                \
<a name="351" /><span class="Maybe">     351:</span>         <span class="m">if</span> <span class="f">(</span><a href="macros_noref.html#_ZXJybm9fMA__"><span class="b">errno</span></a> <span class="f">==</span> <span class="c">0</span><span class="f">)</span> <span class="f">{</span>                                               \
<a name="352" /><span class="Maybe">     352:</span>             <span class="m">if</span> <span class="f">(</span><span class="f">(</span><span class="b">X</span><span class="f">)</span> <span class="f">==</span> <a href="macros_noref.html#_UHlfSFVHRV9WQUxfMA__"><span class="b">Py_HUGE_VAL</span></a> <span class="f">||</span> <span class="f">(</span><span class="b">X</span><span class="f">)</span> <span class="f">==</span> <span class="f">-</span><a href="macros_noref.html#_UHlfSFVHRV9WQUxfMA__"><span class="b">Py_HUGE_VAL</span></a><span class="f">)</span>              \
<a name="353" /><span class="Maybe">     353:</span>                 <a href="macros_noref.html#_ZXJybm9fMA__"><span class="b">errno</span></a> <span class="f">=</span> <a href="macros_noref.html#_RVJBTkdFXzA_"><span class="b">ERANGE</span></a><span class="f">;</span>                                         \
<a name="354" /><span class="Maybe">     354:</span>         <span class="f">}</span>                                                               \
<a name="355" /><span class="Maybe">     355:</span>         <span class="m">else</span> <span class="m">if</span> <span class="f">(</span><a href="macros_noref.html#_ZXJybm9fMA__"><span class="b">errno</span></a> <span class="f">==</span> <a href="macros_noref.html#_RVJBTkdFXzA_"><span class="b">ERANGE</span></a> <span class="f">&amp;&amp;</span> <span class="f">(</span><span class="b">X</span><span class="f">)</span> <span class="f">==</span> <span class="c">0.0</span><span class="f">)</span>                         \
<a name="356" /><span class="Maybe">     356:</span>             <a href="macros_noref.html#_ZXJybm9fMA__"><span class="b">errno</span></a> <span class="f">=</span> <span class="c">0</span><span class="f">;</span>                                                  \
<a name="357" /><span class="Maybe">     357:</span>     <span class="f">}</span> <span class="m">while</span><span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="358" /><span class="Maybe">     358:</span> 
<a name="359" /><span class="Maybe">     359:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQURKVVNUX0VSQU5HRTJfMA__"><span class="b">Py_ADJUST_ERANGE2</span></a><span class="f">(</span><span class="b">X</span><span class="f">,</span> <span class="b">Y</span><span class="f">)</span>                                         \
<a name="360" /><span class="Maybe">     360:</span>     <span class="m">do</span> <span class="f">{</span>                                                                \
<a name="361" /><span class="Maybe">     361:</span>         <span class="m">if</span> <span class="f">(</span><span class="f">(</span><span class="b">X</span><span class="f">)</span> <span class="f">==</span> <a href="macros_noref.html#_UHlfSFVHRV9WQUxfMA__"><span class="b">Py_HUGE_VAL</span></a> <span class="f">||</span> <span class="f">(</span><span class="b">X</span><span class="f">)</span> <span class="f">==</span> <span class="f">-</span><a href="macros_noref.html#_UHlfSFVHRV9WQUxfMA__"><span class="b">Py_HUGE_VAL</span></a> <span class="f">||</span>                \
<a name="362" /><span class="Maybe">     362:</span>             <span class="f">(</span><span class="b">Y</span><span class="f">)</span> <span class="f">==</span> <a href="macros_noref.html#_UHlfSFVHRV9WQUxfMA__"><span class="b">Py_HUGE_VAL</span></a> <span class="f">||</span> <span class="f">(</span><span class="b">Y</span><span class="f">)</span> <span class="f">==</span> <span class="f">-</span><a href="macros_noref.html#_UHlfSFVHRV9WQUxfMA__"><span class="b">Py_HUGE_VAL</span></a><span class="f">)</span> <span class="f">{</span>                \
<a name="363" /><span class="Maybe">     363:</span>                         <span class="m">if</span> <span class="f">(</span><a href="macros_noref.html#_ZXJybm9fMA__"><span class="b">errno</span></a> <span class="f">==</span> <span class="c">0</span><span class="f">)</span>                                 \
<a name="364" /><span class="Maybe">     364:</span>                                 <a href="macros_noref.html#_ZXJybm9fMA__"><span class="b">errno</span></a> <span class="f">=</span> <a href="macros_noref.html#_RVJBTkdFXzA_"><span class="b">ERANGE</span></a><span class="f">;</span>                         \
<a name="365" /><span class="Maybe">     365:</span>         <span class="f">}</span>                                                               \
<a name="366" /><span class="Maybe">     366:</span>         <span class="m">else</span> <span class="m">if</span> <span class="f">(</span><a href="macros_noref.html#_ZXJybm9fMA__"><span class="b">errno</span></a> <span class="f">==</span> <a href="macros_noref.html#_RVJBTkdFXzA_"><span class="b">ERANGE</span></a><span class="f">)</span>                                       \
<a name="367" /><span class="Maybe">     367:</span>             <a href="macros_noref.html#_ZXJybm9fMA__"><span class="b">errno</span></a> <span class="f">=</span> <span class="c">0</span><span class="f">;</span>                                                  \
<a name="368" /><span class="Maybe">     368:</span>     <span class="f">}</span> <span class="m">while</span><span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="369" /><span class="Maybe">     369:</span> 
<a name="370" /><span class="Maybe">     370:</span> <span class="k">/*  The functions _Py_dg_strtod and _Py_dg_dtoa in Python/dtoa.c (which are</span>
<a name="371" /><span class="Maybe">     371:</span> <span class="k"> *  required to support the short float repr introduced in Python 3.1) require</span>
<a name="372" /><span class="Maybe">     372:</span> <span class="k"> *  that the floating-point unit that&apos;s being used for arithmetic operations</span>
<a name="373" /><span class="Maybe">     373:</span> <span class="k"> *  on C doubles is set to use 53-bit precision.  It also requires that the</span>
<a name="374" /><span class="Maybe">     374:</span> <span class="k"> *  FPU rounding mode is round-half-to-even, but that&apos;s less often an issue.</span>
<a name="375" /><span class="Maybe">     375:</span> <span class="k"> *</span>
<a name="376" /><span class="Maybe">     376:</span> <span class="k"> *  If your FPU isn&apos;t already set to 53-bit precision/round-half-to-even, and</span>
<a name="377" /><span class="Maybe">     377:</span> <span class="k"> *  you want to make use of _Py_dg_strtod and _Py_dg_dtoa, then you should</span>
<a name="378" /><span class="Maybe">     378:</span> <span class="k"> *</span>
<a name="379" /><span class="Maybe">     379:</span> <span class="k"> *     #define HAVE_PY_SET_53BIT_PRECISION 1</span>
<a name="380" /><span class="Maybe">     380:</span> <span class="k"> *</span>
<a name="381" /><span class="Maybe">     381:</span> <span class="k"> *  and also give appropriate definitions for the following three macros:</span>
<a name="382" /><span class="Maybe">     382:</span> <span class="k"> *</span>
<a name="383" /><span class="Maybe">     383:</span> <span class="k"> *    _PY_SET_53BIT_PRECISION_START : store original FPU settings, and</span>
<a name="384" /><span class="Maybe">     384:</span> <span class="k"> *        set FPU to 53-bit precision/round-half-to-even</span>
<a name="385" /><span class="Maybe">     385:</span> <span class="k"> *    _PY_SET_53BIT_PRECISION_END : restore original FPU settings</span>
<a name="386" /><span class="Maybe">     386:</span> <span class="k"> *    _PY_SET_53BIT_PRECISION_HEADER : any variable declarations needed to</span>
<a name="387" /><span class="Maybe">     387:</span> <span class="k"> *        use the two macros above.</span>
<a name="388" /><span class="Maybe">     388:</span> <span class="k"> *</span>
<a name="389" /><span class="Maybe">     389:</span> <span class="k"> * The macros are designed to be used within a single C function: see</span>
<a name="390" /><span class="Maybe">     390:</span> <span class="k"> * Python/pystrtod.c for an example of their use.</span>
<a name="391" /><span class="Maybe">     391:</span> <span class="k"> */</span>
<a name="392" /><span class="Maybe">     392:</span> 
<a name="393" /><span class="Maybe">     393:</span> <span class="k">/* get and set x87 control word for gcc/x86 */</span>
<a name="394" /><span class="Maybe">     394:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="macros_ref.html#_SEFWRV9HQ0NfQVNNX0ZPUl9YODdfMA__"><span class="b">HAVE_GCC_ASM_FOR_X87</span></a>
<a name="395" /><span class="Maybe">     395:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_SEFWRV9QWV9TRVRfNTNCSVRfUFJFQ0lTSU9OXzA_"><span class="b">HAVE_PY_SET_53BIT_PRECISION</span></a> <span class="c">1</span>
<a name="396" /><span class="Maybe">     396:</span> <span class="k">/* _Py_get/set_387controlword functions are defined in Python/pymath.c */</span>
<a name="397" /><span class="Maybe">     397:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fSEVBREVSXzA_"><span class="b">_Py_SET_53BIT_PRECISION_HEADER</span></a>                          \
<a name="398" /><span class="Maybe">     398:</span>     <span class="m">unsigned</span> <span class="m">short</span> <span class="b">old_387controlword</span><span class="f">,</span> <span class="b">new_387controlword</span>
<a name="399" /><span class="Maybe">     399:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fU1RBUlRfMA__"><span class="b">_Py_SET_53BIT_PRECISION_START</span></a>                                   \
<a name="400" /><span class="Maybe">     400:</span>     <span class="m">do</span> <span class="f">{</span>                                                                \
<a name="401" /><span class="Maybe">     401:</span>         <span class="b">old_387controlword</span> <span class="f">=</span> <span class="b">_Py_get_387controlword</span><span class="f">(</span><span class="f">)</span><span class="f">;</span>                  \
<a name="402" /><span class="Maybe">     402:</span>         <span class="b">new_387controlword</span> <span class="f">=</span> <span class="f">(</span><span class="b">old_387controlword</span> <span class="f">&amp;</span> <span class="f">~</span><span class="c">0x0f00</span><span class="f">)</span> <span class="f">|</span> <span class="c">0x0200</span><span class="f">;</span> \
<a name="403" /><span class="Maybe">     403:</span>         <span class="m">if</span> <span class="f">(</span><span class="b">new_387controlword</span> <span class="f">!=</span> <span class="b">old_387controlword</span><span class="f">)</span>                   \
<a name="404" /><span class="Maybe">     404:</span>             <span class="b">_Py_set_387controlword</span><span class="f">(</span><span class="b">new_387controlword</span><span class="f">)</span><span class="f">;</span>                 \
<a name="405" /><span class="Maybe">     405:</span>     <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="406" /><span class="Maybe">     406:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fRU5EXzA_"><span class="b">_Py_SET_53BIT_PRECISION_END</span></a>                             \
<a name="407" /><span class="Maybe">     407:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">new_387controlword</span> <span class="f">!=</span> <span class="b">old_387controlword</span><span class="f">)</span>               \
<a name="408" /><span class="Maybe">     408:</span>         <span class="b">_Py_set_387controlword</span><span class="f">(</span><span class="b">old_387controlword</span><span class="f">)</span>
<a name="409" /><span class="Maybe">     409:</span> <span class="f">#</span><span class="n">endif</span>
<a name="410" /><span class="Maybe">     410:</span> 
<a name="411" /><span class="Maybe">     411:</span> <span class="k">/* get and set x87 control word for VisualStudio/x86 */</span>
<a name="412" /><span class="False">     412:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">_MSC_VER</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">_WIN64</span><span class="f">)</span> <span class="k">/* x87 not supported in 64-bit */</span>
<a name="413" /><span class="False">     413:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_SEFWRV9QWV9TRVRfNTNCSVRfUFJFQ0lTSU9OXzA_"><span class="b">HAVE_PY_SET_53BIT_PRECISION</span></a> <span class="c">1</span>
<a name="414" /><span class="False">     414:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fSEVBREVSXzA_"><span class="b">_Py_SET_53BIT_PRECISION_HEADER</span></a> \
<a name="415" /><span class="False">     415:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">old_387controlword</span><span class="f">,</span> <span class="b">new_387controlword</span><span class="f">,</span> <span class="b">out_387controlword</span>
<a name="416" /><span class="False">     416:</span> <span class="k">/* We use the __control87_2 function to set only the x87 control word.</span>
<a name="417" /><span class="False">     417:</span> <span class="k">   The SSE control word is unaffected. */</span>
<a name="418" /><span class="False">     418:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fU1RBUlRfMA__"><span class="b">_Py_SET_53BIT_PRECISION_START</span></a>                                   \
<a name="419" /><span class="False">     419:</span>     <span class="m">do</span> <span class="f">{</span>                                                                \
<a name="420" /><span class="False">     420:</span>         <span class="b">__control87_2</span><span class="f">(</span><span class="c">0</span><span class="f">,</span> <span class="c">0</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">old_387controlword</span><span class="f">,</span> <a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span><span class="f">;</span>                 \
<a name="421" /><span class="False">     421:</span>         <span class="b">new_387controlword</span> <span class="f">=</span>                                            \
<a name="422" /><span class="False">     422:</span>           <span class="f">(</span><span class="b">old_387controlword</span> <span class="f">&amp;</span> <span class="f">~</span><span class="f">(</span><span class="b">_MCW_PC</span> <span class="f">|</span> <span class="b">_MCW_RC</span><span class="f">)</span><span class="f">)</span> <span class="f">|</span> <span class="f">(</span><span class="b">_PC_53</span> <span class="f">|</span> <span class="b">_RC_NEAR</span><span class="f">)</span><span class="f">;</span> \
<a name="423" /><span class="False">     423:</span>         <span class="m">if</span> <span class="f">(</span><span class="b">new_387controlword</span> <span class="f">!=</span> <span class="b">old_387controlword</span><span class="f">)</span>                   \
<a name="424" /><span class="False">     424:</span>             <span class="b">__control87_2</span><span class="f">(</span><span class="b">new_387controlword</span><span class="f">,</span> <span class="b">_MCW_PC</span> <span class="f">|</span> <span class="b">_MCW_RC</span><span class="f">,</span>        \
<a name="425" /><span class="False">     425:</span>                           <span class="f">&amp;</span><span class="b">out_387controlword</span><span class="f">,</span> <a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span><span class="f">;</span>                   \
<a name="426" /><span class="False">     426:</span>     <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="427" /><span class="False">     427:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fRU5EXzA_"><span class="b">_Py_SET_53BIT_PRECISION_END</span></a>                                     \
<a name="428" /><span class="False">     428:</span>     <span class="m">do</span> <span class="f">{</span>                                                                \
<a name="429" /><span class="False">     429:</span>         <span class="m">if</span> <span class="f">(</span><span class="b">new_387controlword</span> <span class="f">!=</span> <span class="b">old_387controlword</span><span class="f">)</span>                   \
<a name="430" /><span class="False">     430:</span>             <span class="b">__control87_2</span><span class="f">(</span><span class="b">old_387controlword</span><span class="f">,</span> <span class="b">_MCW_PC</span> <span class="f">|</span> <span class="b">_MCW_RC</span><span class="f">,</span>        \
<a name="431" /><span class="False">     431:</span>                           <span class="f">&amp;</span><span class="b">out_387controlword</span><span class="f">,</span> <a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span><span class="f">;</span>                   \
<a name="432" /><span class="False">     432:</span>     <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="433" /><span class="Maybe">     433:</span> <span class="f">#</span><span class="n">endif</span>
<a name="434" /><span class="Maybe">     434:</span> 
<a name="435" /><span class="False">     435:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">HAVE_GCC_ASM_FOR_MC68881</span>
<a name="436" /><span class="False">     436:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_SEFWRV9QWV9TRVRfNTNCSVRfUFJFQ0lTSU9OXzA_"><span class="b">HAVE_PY_SET_53BIT_PRECISION</span></a> <span class="c">1</span>
<a name="437" /><span class="False">     437:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fSEVBREVSXzA_"><span class="b">_Py_SET_53BIT_PRECISION_HEADER</span></a> \
<a name="438" /><span class="False">     438:</span>   <span class="m">unsigned</span> <span class="m">int</span> <span class="b">old_fpcr</span><span class="f">,</span> <span class="b">new_fpcr</span>
<a name="439" /><span class="False">     439:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fU1RBUlRfMA__"><span class="b">_Py_SET_53BIT_PRECISION_START</span></a>                                   \
<a name="440" /><span class="False">     440:</span>   <span class="m">do</span> <span class="f">{</span>                                                                  \
<a name="441" /><span class="False">     441:</span>     <span class="b">__asm__</span> <span class="f">(</span><span class="e">&quot;fmove.l %%fpcr,%0&quot;</span> <span class="f">:</span> <span class="e">&quot;=g&quot;</span> <span class="f">(</span><span class="b">old_fpcr</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>                    \
<a name="442" /><span class="False">     442:</span>     <span class="k">/* Set double precision / round to nearest.  */</span>                     \
<a name="443" /><span class="False">     443:</span>     <span class="b">new_fpcr</span> <span class="f">=</span> <span class="f">(</span><span class="b">old_fpcr</span> <span class="f">&amp;</span> <span class="f">~</span><span class="c">0xf0</span><span class="f">)</span> <span class="f">|</span> <span class="c">0x80</span><span class="f">;</span>                               \
<a name="444" /><span class="False">     444:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">new_fpcr</span> <span class="f">!=</span> <span class="b">old_fpcr</span><span class="f">)</span>                                           \
<a name="445" /><span class="False">     445:</span>       <span class="b">__asm__</span> <span class="m">volatile</span> <span class="f">(</span><span class="e">&quot;fmove.l %0,%%fpcr&quot;</span> <span class="f">:</span> <span class="f">:</span> <span class="e">&quot;g&quot;</span> <span class="f">(</span><span class="b">new_fpcr</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>        \
<a name="446" /><span class="False">     446:</span>   <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="447" /><span class="False">     447:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fRU5EXzA_"><span class="b">_Py_SET_53BIT_PRECISION_END</span></a>                                     \
<a name="448" /><span class="False">     448:</span>   <span class="m">do</span> <span class="f">{</span>                                                                  \
<a name="449" /><span class="False">     449:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">new_fpcr</span> <span class="f">!=</span> <span class="b">old_fpcr</span><span class="f">)</span>                                           \
<a name="450" /><span class="False">     450:</span>       <span class="b">__asm__</span> <span class="m">volatile</span> <span class="f">(</span><span class="e">&quot;fmove.l %0,%%fpcr&quot;</span> <span class="f">:</span> <span class="f">:</span> <span class="e">&quot;g&quot;</span> <span class="f">(</span><span class="b">old_fpcr</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>        \
<a name="451" /><span class="False">     451:</span>   <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="452" /><span class="Maybe">     452:</span> <span class="f">#</span><span class="n">endif</span>
<a name="453" /><span class="Maybe">     453:</span> 
<a name="454" /><span class="Maybe">     454:</span> <span class="k">/* default definitions are empty */</span>
<a name="455" /><span class="False">     455:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_SEFWRV9QWV9TRVRfNTNCSVRfUFJFQ0lTSU9OXzA_"><span class="b">HAVE_PY_SET_53BIT_PRECISION</span></a>
<a name="456" /><span class="False">     456:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fSEVBREVSXzA_"><span class="b">_Py_SET_53BIT_PRECISION_HEADER</span></a>
<a name="457" /><span class="False">     457:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fU1RBUlRfMA__"><span class="b">_Py_SET_53BIT_PRECISION_START</span></a>
<a name="458" /><span class="False">     458:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1NFVF81M0JJVF9QUkVDSVNJT05fRU5EXzA_"><span class="b">_Py_SET_53BIT_PRECISION_END</span></a>
<a name="459" /><span class="Maybe">     459:</span> <span class="f">#</span><span class="n">endif</span>
<a name="460" /><span class="Maybe">     460:</span> 
<a name="461" /><span class="Maybe">     461:</span> <span class="k">/* If we can&apos;t guarantee 53-bit precision, don&apos;t use the code</span>
<a name="462" /><span class="Maybe">     462:</span> <span class="k">   in Python/dtoa.c, but fall back to standard code.  This</span>
<a name="463" /><span class="Maybe">     463:</span> <span class="k">   means that repr of a float will be long (17 sig digits).</span>
<a name="464" /><span class="Maybe">     464:</span> <span class="k"></span>
<a name="465" /><span class="Maybe">     465:</span> <span class="k">   Realistically, there are two things that could go wrong:</span>
<a name="466" /><span class="Maybe">     466:</span> <span class="k"></span>
<a name="467" /><span class="Maybe">     467:</span> <span class="k">   (1) doubles aren&apos;t IEEE 754 doubles, or</span>
<a name="468" /><span class="Maybe">     468:</span> <span class="k">   (2) we&apos;re on x86 with the rounding precision set to 64-bits</span>
<a name="469" /><span class="Maybe">     469:</span> <span class="k">       (extended precision), and we don&apos;t know how to change</span>
<a name="470" /><span class="Maybe">     470:</span> <span class="k">       the rounding precision.</span>
<a name="471" /><span class="Maybe">     471:</span> <span class="k"> */</span>
<a name="472" /><span class="Maybe">     472:</span> 
<a name="473" /><span class="False">     473:</span> <span class="f">#</span><span class="n">if</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><a href="macros_ref.html#_RE9VQkxFX0lTX0xJVFRMRV9FTkRJQU5fSUVFRTc1NF8w"><span class="b">DOUBLE_IS_LITTLE_ENDIAN_IEEE754</span></a><span class="f">)</span> <span class="f">&amp;&amp;</span> \
<a name="474" /><span class="False">     474:</span>     <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">DOUBLE_IS_BIG_ENDIAN_IEEE754</span><span class="f">)</span> <span class="f">&amp;&amp;</span> \
<a name="475" /><span class="False">     475:</span>     <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754</span><span class="f">)</span>
<a name="476" /><span class="False">     476:</span> <span class="f">#</span><span class="n">define</span> <span class="b">PY_NO_SHORT_FLOAT_REPR</span>
<a name="477" /><span class="Maybe">     477:</span> <span class="f">#</span><span class="n">endif</span>
<a name="478" /><span class="Maybe">     478:</span> 
<a name="479" /><span class="Maybe">     479:</span> <span class="k">/* double rounding is symptomatic of use of extended precision on x86.  If</span>
<a name="480" /><span class="Maybe">     480:</span> <span class="k">   we&apos;re seeing double rounding, and we don&apos;t have any mechanism available for</span>
<a name="481" /><span class="Maybe">     481:</span> <span class="k">   changing the FPU rounding precision, then don&apos;t use Python/dtoa.c. */</span>
<a name="482" /><span class="False">     482:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">X87_DOUBLE_ROUNDING</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><a href="macros_ref.html#_SEFWRV9QWV9TRVRfNTNCSVRfUFJFQ0lTSU9OXzA_"><span class="b">HAVE_PY_SET_53BIT_PRECISION</span></a><span class="f">)</span>
<a name="483" /><span class="False">     483:</span> <span class="f">#</span><span class="n">define</span> <span class="b">PY_NO_SHORT_FLOAT_REPR</span>
<a name="484" /><span class="Maybe">     484:</span> <span class="f">#</span><span class="n">endif</span>
<a name="485" /><span class="Maybe">     485:</span> 
<a name="486" /><span class="Maybe">     486:</span> 
<a name="487" /><span class="Maybe">     487:</span> <span class="k">/* Py_DEPRECATED(version)</span>
<a name="488" /><span class="Maybe">     488:</span> <span class="k"> * Declare a variable, type, or function deprecated.</span>
<a name="489" /><span class="Maybe">     489:</span> <span class="k"> * Usage:</span>
<a name="490" /><span class="Maybe">     490:</span> <span class="k"> *    extern int old_var Py_DEPRECATED(2.3);</span>
<a name="491" /><span class="Maybe">     491:</span> <span class="k"> *    typedef int T1 Py_DEPRECATED(2.4);</span>
<a name="492" /><span class="Maybe">     492:</span> <span class="k"> *    extern int x() Py_DEPRECATED(2.5);</span>
<a name="493" /><span class="Maybe">     493:</span> <span class="k"> */</span>
<a name="494" /><span class="Maybe">     494:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><a href="macros_ref.html#_X19HTlVDX19fMA__"><span class="b">__GNUC__</span></a><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">(</span><span class="f">(</span><a href="macros_ref.html#_X19HTlVDX19fMA__"><span class="b">__GNUC__</span></a> <span class="f">&gt;=</span> <span class="c">4</span><span class="f">)</span> <span class="f">||</span> \
<a name="495" /><span class="Maybe">     495:</span>               <span class="f">(</span><a href="macros_ref.html#_X19HTlVDX19fMA__"><span class="b">__GNUC__</span></a> <span class="f">==</span> <span class="c">3</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">(</span><span class="b">__GNUC_MINOR__</span> <span class="f">&gt;=</span> <span class="c">1</span><span class="f">)</span><span class="f">)</span>
<a name="496" /><span class="Maybe">     496:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfREVQUkVDQVRFRF8w"><span class="b">Py_DEPRECATED</span></a><span class="f">(</span><span class="b">VERSION_UNUSED</span><span class="f">)</span> <span class="b">__attribute__</span><span class="f">(</span><span class="f">(</span><span class="b">__deprecated__</span><span class="f">)</span><span class="f">)</span>
<a name="497" /><span class="False">     497:</span> <span class="f">#</span><span class="n">else</span>
<a name="498" /><span class="False">     498:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfREVQUkVDQVRFRF8w"><span class="b">Py_DEPRECATED</span></a><span class="f">(</span><span class="b">VERSION_UNUSED</span><span class="f">)</span>
<a name="499" /><span class="Maybe">     499:</span> <span class="f">#</span><span class="n">endif</span>
<a name="500" /><span class="Maybe">     500:</span> 
<a name="501" /><span class="Maybe">     501:</span> <span class="k">/**************************************************************************</span>
<a name="502" /><span class="Maybe">     502:</span> <span class="k">Prototypes that are missing from the standard include files on some systems</span>
<a name="503" /><span class="Maybe">     503:</span> <span class="k">(and possibly only some versions of such systems.)</span>
<a name="504" /><span class="Maybe">     504:</span> <span class="k"></span>
<a name="505" /><span class="Maybe">     505:</span> <span class="k">Please be conservative with adding new ones, document them and enclose them</span>
<a name="506" /><span class="Maybe">     506:</span> <span class="k">in platform-specific #ifdefs.</span>
<a name="507" /><span class="Maybe">     507:</span> <span class="k">**************************************************************************/</span>
<a name="508" /><span class="Maybe">     508:</span> 
<a name="509" /><span class="False">     509:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">SOLARIS</span>
<a name="510" /><span class="False">     510:</span> <span class="k">/* Unchecked */</span>
<a name="511" /><span class="False">     511:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">gethostname</span><span class="f">(</span><span class="m">char</span> <span class="f">*</span><span class="f">,</span> <span class="m">int</span><span class="f">)</span><span class="f">;</span>
<a name="512" /><span class="Maybe">     512:</span> <span class="f">#</span><span class="n">endif</span>
<a name="513" /><span class="Maybe">     513:</span> 
<a name="514" /><span class="False">     514:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">HAVE__GETPTY</span>
<a name="515" /><span class="False">     515:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">sys</span><span class="f">/</span><span class="b">types</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>          <span class="k">/* we need to import mode_t */</span>
<a name="516" /><span class="False">     516:</span> <span class="m">extern</span> <span class="m">char</span> <span class="f">*</span> <span class="b">_getpty</span><span class="f">(</span><span class="m">int</span> <span class="f">*</span><span class="f">,</span> <span class="m">int</span><span class="f">,</span> <span class="b">mode_t</span><span class="f">,</span> <span class="m">int</span><span class="f">)</span><span class="f">;</span>
<a name="517" /><span class="Maybe">     517:</span> <span class="f">#</span><span class="n">endif</span>
<a name="518" /><span class="Maybe">     518:</span> 
<a name="519" /><span class="Maybe">     519:</span> <span class="k">/* On QNX 6, struct termio must be declared by including sys/termio.h</span>
<a name="520" /><span class="Maybe">     520:</span> <span class="k">   if TCGETA, TCSETA, TCSETAW, or TCSETAF are used.  sys/termio.h must</span>
<a name="521" /><span class="Maybe">     521:</span> <span class="k">   be included before termios.h or it will generate an error. */</span>
<a name="522" /><span class="False">     522:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">HAVE_SYS_TERMIO_H</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">__hpux</span><span class="f">)</span>
<a name="523" /><span class="False">     523:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">sys</span><span class="f">/</span><span class="b">termio</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="524" /><span class="Maybe">     524:</span> <span class="f">#</span><span class="n">endif</span>
<a name="525" /><span class="Maybe">     525:</span> 
<a name="526" /><span class="Maybe">     526:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><a href="macros_ref.html#_SEFWRV9PUEVOUFRZXzA_"><span class="b">HAVE_OPENPTY</span></a><span class="f">)</span> <span class="f">||</span> <span class="b">defined</span><span class="f">(</span><a href="macros_ref.html#_SEFWRV9GT1JLUFRZXzA_"><span class="b">HAVE_FORKPTY</span></a><span class="f">)</span>
<a name="527" /><span class="Maybe">     527:</span> <span class="f">#</span><span class="n">if</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">HAVE_PTY_H</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">HAVE_LIBUTIL_H</span><span class="f">)</span>
<a name="528" /><span class="Maybe">     528:</span> <span class="k">/* BSDI does not supply a prototype for the &apos;openpty&apos; and &apos;forkpty&apos;</span>
<a name="529" /><span class="Maybe">     529:</span> <span class="k">   functions, even though they are included in libutil. */</span>
<a name="530" /><span class="Maybe">     530:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">termios</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="531" /><span class="Maybe">     531:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">openpty</span><span class="f">(</span><span class="m">int</span> <span class="f">*</span><span class="f">,</span> <span class="m">int</span> <span class="f">*</span><span class="f">,</span> <span class="m">char</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">termios</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">winsize</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="532" /><span class="Maybe">     532:</span> <span class="m">extern</span> <span class="b">pid_t</span> <span class="b">forkpty</span><span class="f">(</span><span class="m">int</span> <span class="f">*</span><span class="f">,</span> <span class="m">char</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">termios</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">winsize</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="533" /><span class="Maybe">     533:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !defined(HAVE_PTY_H) &amp;&amp; !defined(HAVE_LIBUTIL_H) */</span>
<a name="534" /><span class="Maybe">     534:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) */</span>
<a name="535" /><span class="Maybe">     535:</span> 
<a name="536" /><span class="Maybe">     536:</span> 
<a name="537" /><span class="Maybe">     537:</span> <span class="k">/* On 4.4BSD-descendants, ctype functions serves the whole range of</span>
<a name="538" /><span class="Maybe">     538:</span> <span class="k"> * wchar_t character set rather than single byte code points only.</span>
<a name="539" /><span class="Maybe">     539:</span> <span class="k"> * This characteristic can break some operations of string object</span>
<a name="540" /><span class="Maybe">     540:</span> <span class="k"> * including str.upper() and str.split() on UTF-8 locales.  This</span>
<a name="541" /><span class="Maybe">     541:</span> <span class="k"> * workaround was provided by Tim Robbins of FreeBSD project.</span>
<a name="542" /><span class="Maybe">     542:</span> <span class="k"> */</span>
<a name="543" /><span class="Maybe">     543:</span> 
<a name="544" /><span class="False">     544:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__FreeBSD__</span>
<a name="545" /><span class="False">     545:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">osreldate</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="546" /><span class="False">     546:</span> <span class="f">#</span><span class="n">if</span> <span class="f">(</span><span class="b">__FreeBSD_version</span> <span class="f">&gt;=</span> <span class="c">500040</span> <span class="f">&amp;&amp;</span> <span class="b">__FreeBSD_version</span> <span class="f">&lt;</span> <span class="c">602113</span><span class="f">)</span> <span class="f">||</span> \
<a name="547" /><span class="False">     547:</span>     <span class="f">(</span><span class="b">__FreeBSD_version</span> <span class="f">&gt;=</span> <span class="c">700000</span> <span class="f">&amp;&amp;</span> <span class="b">__FreeBSD_version</span> <span class="f">&lt;</span> <span class="c">700054</span><span class="f">)</span> <span class="f">||</span> \
<a name="548" /><span class="False">     548:</span>     <span class="f">(</span><span class="b">__FreeBSD_version</span> <span class="f">&gt;=</span> <span class="c">800000</span> <span class="f">&amp;&amp;</span> <span class="b">__FreeBSD_version</span> <span class="f">&lt;</span> <span class="c">800001</span><span class="f">)</span>
<a name="549" /><span class="False">     549:</span> <span class="f">#</span> <span class="n">define</span> <span class="b">_PY_PORT_CTYPE_UTF8_ISSUE</span>
<a name="550" /><span class="False">     550:</span> <span class="f">#</span><span class="n">endif</span>
<a name="551" /><span class="Maybe">     551:</span> <span class="f">#</span><span class="n">endif</span>
<a name="552" /><span class="Maybe">     552:</span> 
<a name="553" /><span class="Maybe">     553:</span> 
<a name="554" /><span class="False">     554:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">__APPLE__</span><span class="f">)</span>
<a name="555" /><span class="False">     555:</span> <span class="f">#</span> <span class="n">define</span> <span class="b">_PY_PORT_CTYPE_UTF8_ISSUE</span>
<a name="556" /><span class="Maybe">     556:</span> <span class="f">#</span><span class="n">endif</span>
<a name="557" /><span class="Maybe">     557:</span> 
<a name="558" /><span class="False">     558:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">_PY_PORT_CTYPE_UTF8_ISSUE</span>
<a name="559" /><span class="False">     559:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">__cplusplus</span>
<a name="560" /><span class="False">     560:</span>    <span class="k">/* The workaround below is unsafe in C++ because</span>
<a name="561" /><span class="False">     561:</span> <span class="k">    * the &lt;locale&gt; defines these symbols as real functions,</span>
<a name="562" /><span class="False">     562:</span> <span class="k">    * with a slightly different signature.</span>
<a name="563" /><span class="False">     563:</span> <span class="k">    * See issue #10910</span>
<a name="564" /><span class="False">     564:</span> <span class="k">    */</span>
<a name="565" /><span class="False">     565:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">ctype</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="566" /><span class="False">     566:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">wctype</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="567" /><span class="False">     567:</span> <span class="f">#</span><span class="n">undef</span> <span class="b">isalnum</span>
<a name="568" /><span class="False">     568:</span> <span class="f">#</span><span class="n">define</span> <span class="b">isalnum</span><span class="f">(</span><span class="b">c</span><span class="f">)</span> <span class="b">iswalnum</span><span class="f">(</span><span class="b">btowc</span><span class="f">(</span><span class="b">c</span><span class="f">)</span><span class="f">)</span>
<a name="569" /><span class="False">     569:</span> <span class="f">#</span><span class="n">undef</span> <span class="b">isalpha</span>
<a name="570" /><span class="False">     570:</span> <span class="f">#</span><span class="n">define</span> <span class="b">isalpha</span><span class="f">(</span><span class="b">c</span><span class="f">)</span> <span class="b">iswalpha</span><span class="f">(</span><span class="b">btowc</span><span class="f">(</span><span class="b">c</span><span class="f">)</span><span class="f">)</span>
<a name="571" /><span class="False">     571:</span> <span class="f">#</span><span class="n">undef</span> <span class="b">islower</span>
<a name="572" /><span class="False">     572:</span> <span class="f">#</span><span class="n">define</span> <span class="b">islower</span><span class="f">(</span><span class="b">c</span><span class="f">)</span> <span class="b">iswlower</span><span class="f">(</span><span class="b">btowc</span><span class="f">(</span><span class="b">c</span><span class="f">)</span><span class="f">)</span>
<a name="573" /><span class="False">     573:</span> <span class="f">#</span><span class="n">undef</span> <span class="b">isspace</span>
<a name="574" /><span class="False">     574:</span> <span class="f">#</span><span class="n">define</span> <span class="b">isspace</span><span class="f">(</span><span class="b">c</span><span class="f">)</span> <span class="b">iswspace</span><span class="f">(</span><span class="b">btowc</span><span class="f">(</span><span class="b">c</span><span class="f">)</span><span class="f">)</span>
<a name="575" /><span class="False">     575:</span> <span class="f">#</span><span class="n">undef</span> <span class="b">isupper</span>
<a name="576" /><span class="False">     576:</span> <span class="f">#</span><span class="n">define</span> <span class="b">isupper</span><span class="f">(</span><span class="b">c</span><span class="f">)</span> <span class="b">iswupper</span><span class="f">(</span><span class="b">btowc</span><span class="f">(</span><span class="b">c</span><span class="f">)</span><span class="f">)</span>
<a name="577" /><span class="False">     577:</span> <span class="f">#</span><span class="n">undef</span> <span class="b">tolower</span>
<a name="578" /><span class="False">     578:</span> <span class="f">#</span><span class="n">define</span> <span class="b">tolower</span><span class="f">(</span><span class="b">c</span><span class="f">)</span> <span class="b">towlower</span><span class="f">(</span><span class="b">btowc</span><span class="f">(</span><span class="b">c</span><span class="f">)</span><span class="f">)</span>
<a name="579" /><span class="False">     579:</span> <span class="f">#</span><span class="n">undef</span> <span class="b">toupper</span>
<a name="580" /><span class="False">     580:</span> <span class="f">#</span><span class="n">define</span> <span class="b">toupper</span><span class="f">(</span><span class="b">c</span><span class="f">)</span> <span class="b">towupper</span><span class="f">(</span><span class="b">btowc</span><span class="f">(</span><span class="b">c</span><span class="f">)</span><span class="f">)</span>
<a name="581" /><span class="False">     581:</span> <span class="f">#</span><span class="n">endif</span>
<a name="582" /><span class="Maybe">     582:</span> <span class="f">#</span><span class="n">endif</span>
<a name="583" /><span class="Maybe">     583:</span> 
<a name="584" /><span class="Maybe">     584:</span> 
<a name="585" /><span class="Maybe">     585:</span> <span class="k">/* Declarations for symbol visibility.</span>
<a name="586" /><span class="Maybe">     586:</span> <span class="k"></span>
<a name="587" /><span class="Maybe">     587:</span> <span class="k">  PyAPI_FUNC(type): Declares a public Python API function and return type</span>
<a name="588" /><span class="Maybe">     588:</span> <span class="k">  PyAPI_DATA(type): Declares public Python data and its type</span>
<a name="589" /><span class="Maybe">     589:</span> <span class="k">  PyMODINIT_FUNC:   A Python module init function.  If these functions are</span>
<a name="590" /><span class="Maybe">     590:</span> <span class="k">                    inside the Python core, they are private to the core.</span>
<a name="591" /><span class="Maybe">     591:</span> <span class="k">                    If in an extension module, it may be declared with</span>
<a name="592" /><span class="Maybe">     592:</span> <span class="k">                    external linkage depending on the platform.</span>
<a name="593" /><span class="Maybe">     593:</span> <span class="k"></span>
<a name="594" /><span class="Maybe">     594:</span> <span class="k">  As a number of platforms support/require &quot;__declspec(dllimport/dllexport)&quot;,</span>
<a name="595" /><span class="Maybe">     595:</span> <span class="k">  we support a HAVE_DECLSPEC_DLL macro to save duplication.</span>
<a name="596" /><span class="Maybe">     596:</span> <span class="k">*/</span>
<a name="597" /><span class="Maybe">     597:</span> 
<a name="598" /><span class="Maybe">     598:</span> <span class="k">/*</span>
<a name="599" /><span class="Maybe">     599:</span> <span class="k">  All windows ports, except cygwin, are handled in PC/pyconfig.h.</span>
<a name="600" /><span class="Maybe">     600:</span> <span class="k"></span>
<a name="601" /><span class="Maybe">     601:</span> <span class="k">  Cygwin is the only other autoconf platform requiring special</span>
<a name="602" /><span class="Maybe">     602:</span> <span class="k">  linkage handling and it uses __declspec().</span>
<a name="603" /><span class="Maybe">     603:</span> <span class="k">*/</span>
<a name="604" /><span class="False">     604:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">__CYGWIN__</span><span class="f">)</span>
<a name="605" /><span class="False">     605:</span> <span class="f">#</span>       <span class="n">define</span> <span class="b">HAVE_DECLSPEC_DLL</span>
<a name="606" /><span class="Maybe">     606:</span> <span class="f">#</span><span class="n">endif</span>
<a name="607" /><span class="Maybe">     607:</span> 
<a name="608" /><span class="Maybe">     608:</span> <span class="k">/* only get special linkage if built as shared or platform is Cygwin */</span>
<a name="609" /><span class="False">     609:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">Py_ENABLE_SHARED</span><span class="f">)</span> <span class="f">||</span> <span class="b">defined</span><span class="f">(</span><span class="b">__CYGWIN__</span><span class="f">)</span>
<a name="610" /><span class="False">     610:</span> <span class="f">#</span>       <span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">HAVE_DECLSPEC_DLL</span><span class="f">)</span>
<a name="611" /><span class="False">     611:</span> <span class="f">#</span>               <span class="n">ifdef</span> <span class="b">Py_BUILD_CORE</span>
<a name="612" /><span class="False">     612:</span> <span class="f">#</span>                       <span class="n">define</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">RTYPE</span><span class="f">)</span> <span class="b">__declspec</span><span class="f">(</span><span class="b">dllexport</span><span class="f">)</span> <span class="b">RTYPE</span>
<a name="613" /><span class="False">     613:</span> <span class="f">#</span>                       <span class="n">define</span> <a href="macros_ref.html#_UHlBUElfREFUQV8w"><span class="b">PyAPI_DATA</span></a><span class="f">(</span><span class="b">RTYPE</span><span class="f">)</span> <span class="m">extern</span> <span class="b">__declspec</span><span class="f">(</span><span class="b">dllexport</span><span class="f">)</span> <span class="b">RTYPE</span>
<a name="614" /><span class="False">     614:</span>         <span class="k">/* module init functions inside the core need no external linkage */</span>
<a name="615" /><span class="False">     615:</span>         <span class="k">/* except for Cygwin to handle embedding */</span>
<a name="616" /><span class="False">     616:</span> <span class="f">#</span>                       <span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">__CYGWIN__</span><span class="f">)</span>
<a name="617" /><span class="False">     617:</span> <span class="f">#</span>                               <span class="n">define</span> <a href="macros_ref.html#_UHlNT0RJTklUX0ZVTkNfMA__"><span class="b">PyMODINIT_FUNC</span></a> <span class="b">__declspec</span><span class="f">(</span><span class="b">dllexport</span><span class="f">)</span> <span class="b">PyObject</span><span class="f">*</span>
<a name="618" /><span class="False">     618:</span> <span class="f">#</span>                       <span class="n">else</span> <span class="k">/* __CYGWIN__ */</span>
<a name="619" /><span class="False">     619:</span> <span class="f">#</span>                               <span class="n">define</span> <a href="macros_ref.html#_UHlNT0RJTklUX0ZVTkNfMA__"><span class="b">PyMODINIT_FUNC</span></a> <span class="b">PyObject</span><span class="f">*</span>
<a name="620" /><span class="False">     620:</span> <span class="f">#</span>                       <span class="n">endif</span> <span class="k">/* __CYGWIN__ */</span>
<a name="621" /><span class="False">     621:</span> <span class="f">#</span>               <span class="n">else</span> <span class="k">/* Py_BUILD_CORE */</span>
<a name="622" /><span class="False">     622:</span>         <span class="k">/* Building an extension module, or an embedded situation */</span>
<a name="623" /><span class="False">     623:</span>         <span class="k">/* public Python functions and data are imported */</span>
<a name="624" /><span class="False">     624:</span>         <span class="k">/* Under Cygwin, auto-import functions to prevent compilation */</span>
<a name="625" /><span class="False">     625:</span>         <span class="k">/* failures similar to those described at the bottom of 4.1: */</span>
<a name="626" /><span class="False">     626:</span>         <span class="k">/* http://docs.python.org/extending/windows.html#a-cookbook-approach */</span>
<a name="627" /><span class="False">     627:</span> <span class="f">#</span>                       <span class="n">if</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">__CYGWIN__</span><span class="f">)</span>
<a name="628" /><span class="False">     628:</span> <span class="f">#</span>                               <span class="n">define</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">RTYPE</span><span class="f">)</span> <span class="b">__declspec</span><span class="f">(</span><span class="b">dllimport</span><span class="f">)</span> <span class="b">RTYPE</span>
<a name="629" /><span class="False">     629:</span> <span class="f">#</span>                       <span class="n">endif</span> <span class="k">/* !__CYGWIN__ */</span>
<a name="630" /><span class="False">     630:</span> <span class="f">#</span>                       <span class="n">define</span> <a href="macros_ref.html#_UHlBUElfREFUQV8w"><span class="b">PyAPI_DATA</span></a><span class="f">(</span><span class="b">RTYPE</span><span class="f">)</span> <span class="m">extern</span> <span class="b">__declspec</span><span class="f">(</span><span class="b">dllimport</span><span class="f">)</span> <span class="b">RTYPE</span>
<a name="631" /><span class="False">     631:</span>         <span class="k">/* module init functions outside the core must be exported */</span>
<a name="632" /><span class="False">     632:</span> <span class="f">#</span>                       <span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">__cplusplus</span><span class="f">)</span>
<a name="633" /><span class="False">     633:</span> <span class="f">#</span>                               <span class="n">define</span> <a href="macros_ref.html#_UHlNT0RJTklUX0ZVTkNfMA__"><span class="b">PyMODINIT_FUNC</span></a> <span class="m">extern</span> <span class="e">&quot;C&quot;</span> <span class="b">__declspec</span><span class="f">(</span><span class="b">dllexport</span><span class="f">)</span> <span class="b">PyObject</span><span class="f">*</span>
<a name="634" /><span class="False">     634:</span> <span class="f">#</span>                       <span class="n">else</span> <span class="k">/* __cplusplus */</span>
<a name="635" /><span class="False">     635:</span> <span class="f">#</span>                               <span class="n">define</span> <a href="macros_ref.html#_UHlNT0RJTklUX0ZVTkNfMA__"><span class="b">PyMODINIT_FUNC</span></a> <span class="b">__declspec</span><span class="f">(</span><span class="b">dllexport</span><span class="f">)</span> <span class="b">PyObject</span><span class="f">*</span>
<a name="636" /><span class="False">     636:</span> <span class="f">#</span>                       <span class="n">endif</span> <span class="k">/* __cplusplus */</span>
<a name="637" /><span class="False">     637:</span> <span class="f">#</span>               <span class="n">endif</span> <span class="k">/* Py_BUILD_CORE */</span>
<a name="638" /><span class="False">     638:</span> <span class="f">#</span>       <span class="n">endif</span> <span class="k">/* HAVE_DECLSPEC */</span>
<a name="639" /><span class="Maybe">     639:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* Py_ENABLE_SHARED */</span>
<a name="640" /><span class="Maybe">     640:</span> 
<a name="641" /><span class="Maybe">     641:</span> <span class="k">/* If no external linkage macros defined by now, create defaults */</span>
<a name="642" /><span class="Maybe">     642:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a>
<a name="643" /><span class="Maybe">     643:</span> <span class="f">#</span>       <span class="n">define</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">RTYPE</span><span class="f">)</span> <span class="b">RTYPE</span>
<a name="644" /><span class="Maybe">     644:</span> <span class="f">#</span><span class="n">endif</span>
<a name="645" /><span class="Maybe">     645:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_UHlBUElfREFUQV8w"><span class="b">PyAPI_DATA</span></a>
<a name="646" /><span class="Maybe">     646:</span> <span class="f">#</span>       <span class="n">define</span> <a href="macros_ref.html#_UHlBUElfREFUQV8w"><span class="b">PyAPI_DATA</span></a><span class="f">(</span><span class="b">RTYPE</span><span class="f">)</span> <span class="m">extern</span> <span class="b">RTYPE</span>
<a name="647" /><span class="Maybe">     647:</span> <span class="f">#</span><span class="n">endif</span>
<a name="648" /><span class="Maybe">     648:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_UHlNT0RJTklUX0ZVTkNfMA__"><span class="b">PyMODINIT_FUNC</span></a>
<a name="649" /><span class="False">     649:</span> <span class="f">#</span>       <span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">__cplusplus</span><span class="f">)</span>
<a name="650" /><span class="False">     650:</span> <span class="f">#</span>               <span class="n">define</span> <a href="macros_ref.html#_UHlNT0RJTklUX0ZVTkNfMA__"><span class="b">PyMODINIT_FUNC</span></a> <span class="m">extern</span> <span class="e">&quot;C&quot;</span> <span class="b">PyObject</span><span class="f">*</span>
<a name="651" /><span class="Maybe">     651:</span> <span class="f">#</span>       <span class="n">else</span> <span class="k">/* __cplusplus */</span>
<a name="652" /><span class="Maybe">     652:</span> <span class="f">#</span>               <span class="n">define</span> <a href="macros_ref.html#_UHlNT0RJTklUX0ZVTkNfMA__"><span class="b">PyMODINIT_FUNC</span></a> <span class="b">PyObject</span><span class="f">*</span>
<a name="653" /><span class="Maybe">     653:</span> <span class="f">#</span>       <span class="n">endif</span> <span class="k">/* __cplusplus */</span>
<a name="654" /><span class="Maybe">     654:</span> <span class="f">#</span><span class="n">endif</span>
<a name="655" /><span class="Maybe">     655:</span> 
<a name="656" /><span class="Maybe">     656:</span> <span class="k">/* limits.h constants that may be missing */</span>
<a name="657" /><span class="Maybe">     657:</span> 
<a name="658" /><span class="False">     658:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_SU5UX01BWF8w"><span class="b">INT_MAX</span></a>
<a name="659" /><span class="False">     659:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_SU5UX01BWF8w"><span class="b">INT_MAX</span></a> <span class="c">2147483647</span>
<a name="660" /><span class="Maybe">     660:</span> <span class="f">#</span><span class="n">endif</span>
<a name="661" /><span class="Maybe">     661:</span> 
<a name="662" /><span class="False">     662:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_TE9OR19NQVhfMA__"><span class="b">LONG_MAX</span></a>
<a name="663" /><span class="False">     663:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_U0laRU9GX0xPTkdfMA__"><span class="b">SIZEOF_LONG</span></a> <span class="f">==</span> <span class="c">4</span>
<a name="664" /><span class="False">     664:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_TE9OR19NQVhfMA__"><span class="b">LONG_MAX</span></a> <span class="c">0X7FFFFFFFL</span>
<a name="665" /><span class="False">     665:</span> <span class="f">#</span><span class="n">elif</span> <a href="macros_ref.html#_U0laRU9GX0xPTkdfMA__"><span class="b">SIZEOF_LONG</span></a> <span class="f">==</span> <span class="c">8</span>
<a name="666" /><span class="False">     666:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_TE9OR19NQVhfMA__"><span class="b">LONG_MAX</span></a> <span class="c">0X7FFFFFFFFFFFFFFFL</span>
<a name="667" /><span class="False">     667:</span> <span class="f">#</span><span class="n">else</span>
<a name="668" /><span class="False">     668:</span> <span class="f">#</span><span class="n">error</span> <span class="e">&quot;could not set LONG_MAX in pyport.h&quot;</span>
<a name="669" /><span class="False">     669:</span> <span class="f">#</span><span class="n">endif</span>
<a name="670" /><span class="Maybe">     670:</span> <span class="f">#</span><span class="n">endif</span>
<a name="671" /><span class="Maybe">     671:</span> 
<a name="672" /><span class="False">     672:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_TE9OR19NSU5fMA__"><span class="b">LONG_MIN</span></a>
<a name="673" /><span class="False">     673:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_TE9OR19NSU5fMA__"><span class="b">LONG_MIN</span></a> <span class="f">(</span><span class="f">-</span><a href="macros_ref.html#_TE9OR19NQVhfMA__"><span class="b">LONG_MAX</span></a><span class="f">-</span><span class="c">1</span><span class="f">)</span>
<a name="674" /><span class="Maybe">     674:</span> <span class="f">#</span><span class="n">endif</span>
<a name="675" /><span class="Maybe">     675:</span> 
<a name="676" /><span class="False">     676:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_TE9OR19CSVRfMA__"><span class="b">LONG_BIT</span></a>
<a name="677" /><span class="False">     677:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_TE9OR19CSVRfMA__"><span class="b">LONG_BIT</span></a> <span class="f">(</span><span class="c">8</span> <span class="f">*</span> <a href="macros_ref.html#_U0laRU9GX0xPTkdfMA__"><span class="b">SIZEOF_LONG</span></a><span class="f">)</span>
<a name="678" /><span class="Maybe">     678:</span> <span class="f">#</span><span class="n">endif</span>
<a name="679" /><span class="Maybe">     679:</span> 
<a name="680" /><span class="False">     680:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_TE9OR19CSVRfMA__"><span class="b">LONG_BIT</span></a> <span class="f">!=</span> <span class="c">8</span> <span class="f">*</span> <a href="macros_ref.html#_U0laRU9GX0xPTkdfMA__"><span class="b">SIZEOF_LONG</span></a>
<a name="681" /><span class="False">     681:</span> <span class="k">/* 04-Oct-2000 LONG_BIT is apparently (mis)defined as 64 on some recent</span>
<a name="682" /><span class="False">     682:</span> <span class="k"> * 32-bit platforms using gcc.  We try to catch that here at compile-time</span>
<a name="683" /><span class="False">     683:</span> <span class="k"> * rather than waiting for integer multiplication to trigger bogus</span>
<a name="684" /><span class="False">     684:</span> <span class="k"> * overflows.</span>
<a name="685" /><span class="False">     685:</span> <span class="k"> */</span>
<a name="686" /><span class="False">     686:</span> <span class="f">#</span><span class="n">error</span> <span class="e">&quot;LONG_BIT definition appears wrong for platform (bad gcc/glibc config?).&quot;</span>
<a name="687" /><span class="Maybe">     687:</span> <span class="f">#</span><span class="n">endif</span>
<a name="688" /><span class="Maybe">     688:</span> 
<a name="689" /><span class="False">     689:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__cplusplus</span>
<a name="690" /><span class="False">     690:</span> <span class="f">}</span>
<a name="691" /><span class="Maybe">     691:</span> <span class="f">#</span><span class="n">endif</span>
<a name="692" /><span class="Maybe">     692:</span> 
<a name="693" /><span class="Maybe">     693:</span> <span class="k">/*</span>
<a name="694" /><span class="Maybe">     694:</span> <span class="k"> * Hide GCC attributes from compilers that don&apos;t support them.</span>
<a name="695" /><span class="Maybe">     695:</span> <span class="k"> */</span>
<a name="696" /><span class="False">     696:</span> <span class="f">#</span><span class="n">if</span> <span class="f">(</span><span class="f">!</span><span class="b">defined</span><span class="f">(</span><a href="macros_ref.html#_X19HTlVDX19fMA__"><span class="b">__GNUC__</span></a><span class="f">)</span> <span class="f">||</span> <a href="macros_ref.html#_X19HTlVDX19fMA__"><span class="b">__GNUC__</span></a> <span class="f">&lt;</span> <span class="c">2</span> <span class="f">||</span> \
<a name="697" /><span class="False">     697:</span>      <span class="f">(</span><a href="macros_ref.html#_X19HTlVDX19fMA__"><span class="b">__GNUC__</span></a> <span class="f">==</span> <span class="c">2</span> <span class="f">&amp;&amp;</span> <span class="b">__GNUC_MINOR__</span> <span class="f">&lt;</span> <span class="c">7</span><span class="f">)</span> <span class="f">)</span>
<a name="698" /><span class="False">     698:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfR0NDX0FUVFJJQlVURV8w"><span class="b">Py_GCC_ATTRIBUTE</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span>
<a name="699" /><span class="Maybe">     699:</span> <span class="f">#</span><span class="n">else</span>
<a name="700" /><span class="Maybe">     700:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfR0NDX0FUVFJJQlVURV8w"><span class="b">Py_GCC_ATTRIBUTE</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="b">__attribute__</span><span class="f">(</span><span class="b">x</span><span class="f">)</span>
<a name="701" /><span class="Maybe">     701:</span> <span class="f">#</span><span class="n">endif</span>
<a name="702" /><span class="Maybe">     702:</span> 
<a name="703" /><span class="Maybe">     703:</span> <span class="k">/*</span>
<a name="704" /><span class="Maybe">     704:</span> <span class="k"> * Specify alignment on compilers that support it.</span>
<a name="705" /><span class="Maybe">     705:</span> <span class="k"> */</span>
<a name="706" /><span class="Maybe">     706:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><a href="macros_ref.html#_X19HTlVDX19fMA__"><span class="b">__GNUC__</span></a><span class="f">)</span> <span class="f">&amp;&amp;</span> <a href="macros_ref.html#_X19HTlVDX19fMA__"><span class="b">__GNUC__</span></a> <span class="f">&gt;=</span> <span class="c">3</span>
<a name="707" /><span class="Maybe">     707:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQUxJR05FRF8w"><span class="b">Py_ALIGNED</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="b">__attribute__</span><span class="f">(</span><span class="f">(</span><span class="b">aligned</span><span class="f">(</span><span class="b">x</span><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="708" /><span class="False">     708:</span> <span class="f">#</span><span class="n">else</span>
<a name="709" /><span class="False">     709:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQUxJR05FRF8w"><span class="b">Py_ALIGNED</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span>
<a name="710" /><span class="Maybe">     710:</span> <span class="f">#</span><span class="n">endif</span>
<a name="711" /><span class="Maybe">     711:</span> 
<a name="712" /><span class="Maybe">     712:</span> <span class="k">/* Eliminate end-of-loop code not reached warnings from SunPro C</span>
<a name="713" /><span class="Maybe">     713:</span> <span class="k"> * when using do{...}while(0) macros</span>
<a name="714" /><span class="Maybe">     714:</span> <span class="k"> */</span>
<a name="715" /><span class="False">     715:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__SUNPRO_C</span>
<a name="716" /><span class="False">     716:</span> <span class="f">#</span><span class="n">pragma</span> <span class="b">error_messages</span> <span class="f">(</span><span class="b">off</span><span class="f">,</span><span class="b">E_END_OF_LOOP_CODE_NOT_REACHED</span><span class="f">)</span>
<a name="717" /><span class="Maybe">     717:</span> <span class="f">#</span><span class="n">endif</span>
<a name="718" /><span class="Maybe">     718:</span> 
<a name="719" /><span class="Maybe">     719:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_UHlfTExfMA__"><span class="b">Py_LL</span></a>
<a name="720" /><span class="Maybe">     720:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfTExfMA__"><span class="b">Py_LL</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="b">x</span><span class="f">##</span><span class="b">LL</span>
<a name="721" /><span class="Maybe">     721:</span> <span class="f">#</span><span class="n">endif</span>
<a name="722" /><span class="Maybe">     722:</span> 
<a name="723" /><span class="Maybe">     723:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_ref.html#_UHlfVUxMXzA_"><span class="b">Py_ULL</span></a>
<a name="724" /><span class="Maybe">     724:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlfVUxMXzA_"><span class="b">Py_ULL</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span> <a href="macros_ref.html#_UHlfTExfMA__"><span class="b">Py_LL</span></a><span class="f">(</span><span class="b">x</span><span class="f">##</span><span class="b">U</span><span class="f">)</span>
<a name="725" /><span class="Maybe">     725:</span> <span class="f">#</span><span class="n">endif</span>
<a name="726" /><span class="Maybe">     726:</span> 
<a name="727" /><span class="Maybe">     727:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfVkFfQ09QWV8w"><span class="b">Py_VA_COPY</span></a> <span class="b">va_copy</span>
<a name="728" /><span class="Maybe">     728:</span> 
<a name="729" /><span class="Maybe">     729:</span> <span class="k">/*</span>
<a name="730" /><span class="Maybe">     730:</span> <span class="k"> * Convenient macros to deal with endianness of the platform. WORDS_BIGENDIAN is</span>
<a name="731" /><span class="Maybe">     731:</span> <span class="k"> * detected by configure and defined in pyconfig.h. The code in pyconfig.h</span>
<a name="732" /><span class="Maybe">     732:</span> <span class="k"> * also takes care of Apple&apos;s universal builds.</span>
<a name="733" /><span class="Maybe">     733:</span> <span class="k"> */</span>
<a name="734" /><span class="Maybe">     734:</span> 
<a name="735" /><span class="False">     735:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">WORDS_BIGENDIAN</span>
<a name="736" /><span class="False">     736:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfQklHX0VORElBTl8w"><span class="b">PY_BIG_ENDIAN</span></a> <span class="c">1</span>
<a name="737" /><span class="False">     737:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfTElUVExFX0VORElBTl8w"><span class="b">PY_LITTLE_ENDIAN</span></a> <span class="c">0</span>
<a name="738" /><span class="Maybe">     738:</span> <span class="f">#</span><span class="n">else</span>
<a name="739" /><span class="Maybe">     739:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfQklHX0VORElBTl8w"><span class="b">PY_BIG_ENDIAN</span></a> <span class="c">0</span>
<a name="740" /><span class="Maybe">     740:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfTElUVExFX0VORElBTl8w"><span class="b">PY_LITTLE_ENDIAN</span></a> <span class="c">1</span>
<a name="741" /><span class="Maybe">     741:</span> <span class="f">#</span><span class="n">endif</span>
<a name="742" /><span class="Maybe">     742:</span> 
<a name="743" /><span class="False">     743:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">Py_BUILD_CORE</span>
<a name="744" /><span class="False">     744:</span> <span class="k">/*</span>
<a name="745" /><span class="False">     745:</span> <span class="k"> * Macros to protect CRT calls against instant termination when passed an</span>
<a name="746" /><span class="False">     746:</span> <span class="k"> * invalid parameter (issue23524).</span>
<a name="747" /><span class="False">     747:</span> <span class="k"> */</span>
<a name="748" /><span class="False">     748:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span> <span class="b">_MSC_VER</span> <span class="f">&amp;&amp;</span> <span class="b">_MSC_VER</span> <span class="f">&gt;=</span> <span class="c">1900</span>
<a name="749" /><span class="False">     749:</span> 
<a name="750" /><span class="False">     750:</span> <span class="m">extern</span> <span class="b">_invalid_parameter_handler</span> <span class="b">_Py_silent_invalid_parameter_handler</span><span class="f">;</span>
<a name="751" /><span class="False">     751:</span> <span class="f">#</span><span class="n">define</span> <span class="b">_Py_BEGIN_SUPPRESS_IPH</span> <span class="f">{</span> <span class="b">_invalid_parameter_handler</span> <span class="b">_Py_old_handler</span> <span class="f">=</span> \
<a name="752" /><span class="False">     752:</span>     <span class="b">_set_thread_local_invalid_parameter_handler</span><span class="f">(</span><span class="b">_Py_silent_invalid_parameter_handler</span><span class="f">)</span><span class="f">;</span>
<a name="753" /><span class="False">     753:</span> <span class="f">#</span><span class="n">define</span> <span class="b">_Py_END_SUPPRESS_IPH</span> <span class="b">_set_thread_local_invalid_parameter_handler</span><span class="f">(</span><span class="b">_Py_old_handler</span><span class="f">)</span><span class="f">;</span> <span class="f">}</span>
<a name="754" /><span class="False">     754:</span> 
<a name="755" /><span class="False">     755:</span> <span class="f">#</span><span class="n">else</span>
<a name="756" /><span class="False">     756:</span> 
<a name="757" /><span class="False">     757:</span> <span class="f">#</span><span class="n">define</span> <span class="b">_Py_BEGIN_SUPPRESS_IPH</span>
<a name="758" /><span class="False">     758:</span> <span class="f">#</span><span class="n">define</span> <span class="b">_Py_END_SUPPRESS_IPH</span>
<a name="759" /><span class="False">     759:</span> 
<a name="760" /><span class="False">     760:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* _MSC_VER &gt;= 1900 */</span>
<a name="761" /><span class="Maybe">     761:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* Py_BUILD_CORE */</span>
<a name="762" /><span class="Maybe">     762:</span> 
<a name="763" /><span class="False">     763:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__ANDROID__</span>
<a name="764" /><span class="False">     764:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">android</span><span class="f">/</span><span class="b">api</span><span class="f">-</span><span class="b">level</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="765" /><span class="Maybe">     765:</span> <span class="f">#</span><span class="n">endif</span>
<a name="766" /><span class="Maybe">     766:</span> 
<a name="767" /><span class="True">     767:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* Py_PYPORT_H */</span>
<a name="768" /><span class="True">     768:</span> </pre>
  </body>
</html>
